util:test: test_ms_fn_match_protocol_no_wildcard: allow -1
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 4 Apr 2024 04:23:15 +0000 (17:23 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Apr 2024 22:56:33 +0000 (22:56 +0000)
We have changed strcasecmp_m() to return -1 in a place where it used
to return -3. This upset a test, but it shouldn't have: the exact
value of the negative int is not guaranteed by the function.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/tests/test_ms_fnmatch.c
selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard [deleted file]

index d11c7bed4becf8a9fb5e0b0a1922f1a988b30332..2261f9bb111bfb4d1441f75c5bec2b923d5d8484 100644 (file)
@@ -36,7 +36,7 @@ static void test_ms_fn_match_protocol_no_wildcard(void **state)
        /* no wildcards in pattern, a simple strcasecmp_m */
        cmp = ms_fnmatch_protocol("pattern", "string", PROTOCOL_COREPLUS,
                                  true);        /* case sensitive */
-       assert_int_equal(cmp, -3);
+       assert_true(cmp < 0);
 }
 
 static void test_ms_fn_match_protocol_pattern_upgraded(void **state)
diff --git a/selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard b/selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard
deleted file mode 100644 (file)
index fe0d14e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba.unittests.ms_fnmatch.test_ms_fn_match_protocol_no_wildcard