mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 06:28:05 +02:00
core/tests: skip test for nm_wildcard_match_check() on non-glibc
It seems musl's fnmatch() does not support ranges and fails the test. Skip it. Seen on musl-1.1.24-r10.
This commit is contained in:
parent
ca8162cb41
commit
3a2b4ffd0a
1 changed files with 13 additions and 5 deletions
|
|
@ -980,10 +980,11 @@ test_connection_match_ip6_routes(void)
|
|||
g_assert(matched == copy);
|
||||
}
|
||||
|
||||
#define do_test_wildcard_match(str, result, ...) \
|
||||
g_assert( \
|
||||
nm_wildcard_match_check(str, (const char *const[]){__VA_ARGS__}, NM_NARG(__VA_ARGS__)) \
|
||||
== result);
|
||||
#define do_test_wildcard_match_eval(str, ...) \
|
||||
nm_wildcard_match_check(str, (const char *const[]){__VA_ARGS__}, NM_NARG(__VA_ARGS__))
|
||||
|
||||
#define do_test_wildcard_match(str, result, ...) \
|
||||
g_assert(do_test_wildcard_match_eval(str, __VA_ARGS__) == result)
|
||||
|
||||
static void
|
||||
test_wildcard_match(void)
|
||||
|
|
@ -1056,7 +1057,14 @@ test_wildcard_match(void)
|
|||
do_test_wildcard_match("name3", TRUE, "name[123]");
|
||||
do_test_wildcard_match("name4", FALSE, "name[123]");
|
||||
|
||||
do_test_wildcard_match("[a]", TRUE, "\\[a\\]");
|
||||
if (do_test_wildcard_match_eval("[a]", "\\[a\\]") != TRUE) {
|
||||
#if defined(__GLIBC__)
|
||||
do_test_wildcard_match("[a]", TRUE, "\\[a\\]");
|
||||
g_assert_not_reached();
|
||||
#endif
|
||||
/* It seems musl's fnmatch() does not like such ranges. */
|
||||
g_test_skip("libc does not support ranges with fnmatch()!!");
|
||||
}
|
||||
|
||||
do_test_wildcard_match("aa", FALSE, "!a*");
|
||||
do_test_wildcard_match("aa", FALSE, "&!a*");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue