Revision 19204,
1002 bytes
checked in by zacheiss, 21 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r19203,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2001 Sendmail, Inc. and its suppliers. |
---|
3 | * All rights reserved. |
---|
4 | * |
---|
5 | * By using this file, you agree to the terms and conditions set |
---|
6 | * forth in the LICENSE file which can be found at the top level of |
---|
7 | * the sendmail distribution. |
---|
8 | */ |
---|
9 | |
---|
10 | #include <sm/gen.h> |
---|
11 | SM_IDSTR(id, "@(#)$Id: t-strrevcmp.c,v 1.1.1.1 2003-04-08 15:06:05 zacheiss Exp $") |
---|
12 | |
---|
13 | #include <sm/exc.h> |
---|
14 | #include <sm/io.h> |
---|
15 | #include <sm/string.h> |
---|
16 | #include <sm/test.h> |
---|
17 | |
---|
18 | int |
---|
19 | main(argc, argv) |
---|
20 | int argc; |
---|
21 | char **argv; |
---|
22 | { |
---|
23 | char *s1; |
---|
24 | char *s2; |
---|
25 | |
---|
26 | sm_test_begin(argc, argv, "test string compare"); |
---|
27 | |
---|
28 | s1 = "equal"; |
---|
29 | s2 = "equal"; |
---|
30 | SM_TEST(sm_strrevcmp(s1, s2) == 0); |
---|
31 | |
---|
32 | s1 = "equal"; |
---|
33 | s2 = "qual"; |
---|
34 | SM_TEST(sm_strrevcmp(s1, s2) > 0); |
---|
35 | |
---|
36 | s1 = "qual"; |
---|
37 | s2 = "equal"; |
---|
38 | SM_TEST(sm_strrevcmp(s1, s2) < 0); |
---|
39 | |
---|
40 | s1 = "Equal"; |
---|
41 | s2 = "equal"; |
---|
42 | SM_TEST(sm_strrevcmp(s1, s2) < 0); |
---|
43 | |
---|
44 | s1 = "Equal"; |
---|
45 | s2 = "equal"; |
---|
46 | SM_TEST(sm_strrevcasecmp(s1, s2) == 0); |
---|
47 | |
---|
48 | s1 = "Equal"; |
---|
49 | s2 = "eQuaL"; |
---|
50 | SM_TEST(sm_strrevcasecmp(s1, s2) == 0); |
---|
51 | |
---|
52 | return sm_test_end(); |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.