1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2001 Sendmail, Inc. and its suppliers.
3*7c478bd9Sstevel@tonic-gate  *	All rights reserved.
4*7c478bd9Sstevel@tonic-gate  *
5*7c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
6*7c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
7*7c478bd9Sstevel@tonic-gate  * the sendmail distribution.
8*7c478bd9Sstevel@tonic-gate  */
9*7c478bd9Sstevel@tonic-gate 
10*7c478bd9Sstevel@tonic-gate #include <sm/gen.h>
11*7c478bd9Sstevel@tonic-gate SM_IDSTR(id, "@(#)$Id: t-strrevcmp.c,v 1.1 2001/07/16 21:35:28 ca Exp $")
12*7c478bd9Sstevel@tonic-gate 
13*7c478bd9Sstevel@tonic-gate #include <sm/exc.h>
14*7c478bd9Sstevel@tonic-gate #include <sm/io.h>
15*7c478bd9Sstevel@tonic-gate #include <sm/string.h>
16*7c478bd9Sstevel@tonic-gate #include <sm/test.h>
17*7c478bd9Sstevel@tonic-gate 
18*7c478bd9Sstevel@tonic-gate int
19*7c478bd9Sstevel@tonic-gate main(argc, argv)
20*7c478bd9Sstevel@tonic-gate 	int argc;
21*7c478bd9Sstevel@tonic-gate 	char **argv;
22*7c478bd9Sstevel@tonic-gate {
23*7c478bd9Sstevel@tonic-gate 	char *s1;
24*7c478bd9Sstevel@tonic-gate 	char *s2;
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate 	sm_test_begin(argc, argv, "test string compare");
27*7c478bd9Sstevel@tonic-gate 
28*7c478bd9Sstevel@tonic-gate 	s1 = "equal";
29*7c478bd9Sstevel@tonic-gate 	s2 = "equal";
30*7c478bd9Sstevel@tonic-gate 	SM_TEST(sm_strrevcmp(s1, s2) == 0);
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate 	s1 = "equal";
33*7c478bd9Sstevel@tonic-gate 	s2 = "qual";
34*7c478bd9Sstevel@tonic-gate 	SM_TEST(sm_strrevcmp(s1, s2) > 0);
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate 	s1 = "qual";
37*7c478bd9Sstevel@tonic-gate 	s2 = "equal";
38*7c478bd9Sstevel@tonic-gate 	SM_TEST(sm_strrevcmp(s1, s2) < 0);
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate 	s1 = "Equal";
41*7c478bd9Sstevel@tonic-gate 	s2 = "equal";
42*7c478bd9Sstevel@tonic-gate 	SM_TEST(sm_strrevcmp(s1, s2) < 0);
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate 	s1 = "Equal";
45*7c478bd9Sstevel@tonic-gate 	s2 = "equal";
46*7c478bd9Sstevel@tonic-gate 	SM_TEST(sm_strrevcasecmp(s1, s2) == 0);
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate 	s1 = "Equal";
49*7c478bd9Sstevel@tonic-gate 	s2 = "eQuaL";
50*7c478bd9Sstevel@tonic-gate 	SM_TEST(sm_strrevcasecmp(s1, s2) == 0);
51*7c478bd9Sstevel@tonic-gate 
52*7c478bd9Sstevel@tonic-gate 	return sm_test_end();
53*7c478bd9Sstevel@tonic-gate }
54