--------------------- PatchSet 10281 Date: 2007/12/19 11:51:36 Author: adri Branch: s27_adri Tag: (none) Log: Flesh out some more basic string module checkin. Members: test-suite/check_str.c:1.1.2.1->1.1.2.2 Index: squid/test-suite/check_str.c =================================================================== RCS file: /cvsroot/squid-sf//squid/test-suite/Attic/check_str.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/test-suite/check_str.c 17 Dec 2007 16:37:13 -0000 1.1.2.1 +++ squid/test-suite/check_str.c 19 Dec 2007 11:51:36 -0000 1.1.2.2 @@ -35,6 +35,51 @@ } int +check_cmp1(void) +{ + String s1 = StringNull; + String s2 = StringNull; + const char *sc1 = "abc", *sc2 = "abcdef"; + + strCat(s1, "abc"); + strCat(s2, "abcdef"); + printf("compare abc to abcdef: %d\n", strCmpStr(s1, s2)); + return 1; +} + +int +check_cmp2(void) +{ + String s1 = StringNull; + String s2 = StringNull; + + strCat(s1, "abcdef"); + strCat(s2, "abc"); + printf("compare abcdef to abc: %d\n", strCmpStr(s1, s2)); +} + +int +check_cmp3(void) +{ + String s1 = StringNull; + String s2 = StringNull; + + strCat(s1, "abc"); + strCat(s2, "abc"); + printf("compare abc to abc: %d\n", strCmpStr(s1, s2)); +} + +int +check_cmp4(void) +{ + String s1 = StringNull; + const char *s2 = "abc"; + + strCat(s1, "abc"); + printf("compare abc to cstr abc: %d\n", strCmp(s1, s2)); +} + +int main(int argc, const char *argv[]) { @@ -43,6 +88,10 @@ buf_init(); check1(); + check_cmp1(); + check_cmp2(); + check_cmp3(); + check_cmp4(); exit(0); }