]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
lib/printf_test.c: test on strcmp fixed
authorMaria Matejka <mq@ucw.cz>
Sat, 11 May 2024 14:36:49 +0000 (16:36 +0200)
committerMaria Matejka <mq@ucw.cz>
Mon, 13 May 2024 06:52:48 +0000 (08:52 +0200)
we mistakenly required the return value to be only -1, 0 or 1

lib/printf_test.c

index 88ecf05e2c9fe5789d2209d621dc69261c873707..3b26ec1716a863e84928c79b05d558f10f05240e 100644 (file)
@@ -108,11 +108,11 @@ static int
 t_bstrcmp(void)
 {
   bt_assert(bstrcmp("aa", "aa") == 0);
-  bt_assert(bstrcmp("aa", "bb") == -1);
-  bt_assert(bstrcmp("bb", "aa") == 1);
+  bt_assert(bstrcmp("aa", "bb") < 0);
+  bt_assert(bstrcmp("bb", "aa") > 0);
   bt_assert(bstrcmp(NULL, NULL) == 0);
-  bt_assert(bstrcmp(NULL, "bb") == -1);
-  bt_assert(bstrcmp("bb", NULL) == 1);
+  bt_assert(bstrcmp(NULL, "bb") < 0);
+  bt_assert(bstrcmp("bb", NULL) > 0);
 
   return 1;
 }