12 { "B0075022800016.gbp.corp.com", "B007502280067.gbp.corp.com" },
13 { "B0075022800016.gbp.corp.com", "B007502357019.GBP.CORP.COM" },
14 { "B007502280067.gbp.corp.com", "B007502357019.GBP.CORP.COM" }
16 #define ntests (sizeof (tests) / sizeof (tests[0]))
20 compare (const char *str1
, const char *str2
, int exp
)
22 int c
= strverscmp (str1
, str2
);
33 for (int i
= 0; i
< ntests
; ++i
)
35 if (compare (tests
[i
].str1
, tests
[i
].str2
, -1))
37 printf ("FAIL: \"%s\" > \"%s\"\n", tests
[i
].str1
, tests
[i
].str2
);
40 if (compare (tests
[i
].str2
, tests
[i
].str1
, +1))
42 printf ("FAIL: \"%s\" > \"%s\"\n", tests
[i
].str2
, tests
[i
].str1
);
45 char *copy1
= strdupa (tests
[i
].str1
);
46 if (compare (tests
[i
].str1
, copy1
, 0))
48 printf ("FAIL: \"%s\" != \"%s\"\n", tests
[i
].str1
, copy1
);
51 char *copy2
= strdupa (tests
[i
].str2
);
52 if (compare (tests
[i
].str2
, copy2
, 0))
54 printf ("FAIL: \"%s\" != \"%s\"\n", tests
[i
].str2
, copy2
);
61 #define TEST_FUNCTION do_test ()
62 #include "../test-skeleton.c"