This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <config.h>
19
20 #include "memcoll.h"
21
22 #include <string.h>
23
24 #include "macros.h"
25
26 int
27 main (void)
28 {
29
30 ASSERT (memcoll0 ("", 1, "", 1) == 0);
31 ASSERT (memcoll0 ("fo", 3, "fo", 3) == 0);
32 ASSERT (memcoll0 ("foo", 4, "foo", 4) == 0);
33 ASSERT (memcoll0 ("foo\0", 5, "foob", 5) != 0);
34 ASSERT (memcoll0 ("f", 2, "b", 2) != 0);
35 ASSERT (memcoll0 ("foo", 4, "bar", 4) != 0);
36
37
38 ASSERT (memcoll0 ("foo\0", 5, "moo\0", 5) < 0);
39 ASSERT (memcoll0 ("moo\0", 5, "foo\0", 5) > 0);
40 ASSERT (memcoll0 ("oom", 4, "oop", 4) < 0);
41 ASSERT (memcoll0 ("oop", 4, "oom", 4) > 0);
42 ASSERT (memcoll0 ("foo\0", 5, "foob", 5) < 0);
43 ASSERT (memcoll0 ("foob", 5, "foo\0", 5) > 0);
44
45
46 ASSERT (memcoll0 ("1\0", 3, "2\0", 3) < 0);
47 ASSERT (memcoll0 ("2\0", 3, "1\0", 3) > 0);
48 ASSERT (memcoll0 ("x\0""1", 4, "x\0""2", 4) < 0);
49 ASSERT (memcoll0 ("x\0""2", 4, "x\0""1", 4) > 0);
50
51 return 0;
52 }