Fix -Wmissing-braces warnings by adding braces around all the

testcase inputs

MFC after: 1 week
X-MFC with: r290572
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2015-11-15 05:13:33 +00:00
parent 397f4a0de5
commit dd3d75ba5f

View File

@ -35,142 +35,142 @@ struct testcase {
int flags;
int result;
} testcases[] = {
"", "", 0, 0,
"a", "a", 0, 0,
"a", "b", 0, FNM_NOMATCH,
"a", "A", 0, FNM_NOMATCH,
"*", "a", 0, 0,
"*", "aa", 0, 0,
"*a", "a", 0, 0,
"*a", "b", 0, FNM_NOMATCH,
"*a*", "b", 0, FNM_NOMATCH,
"*a*b*", "ab", 0, 0,
"*a*b*", "qaqbq", 0, 0,
"*a*bb*", "qaqbqbbq", 0, 0,
"*a*bc*", "qaqbqbcq", 0, 0,
"*a*bb*", "qaqbqbb", 0, 0,
"*a*bc*", "qaqbqbc", 0, 0,
"*a*bb", "qaqbqbb", 0, 0,
"*a*bc", "qaqbqbc", 0, 0,
"*a*bb", "qaqbqbbq", 0, FNM_NOMATCH,
"*a*bc", "qaqbqbcq", 0, FNM_NOMATCH,
"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH,
"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0,
"*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0,
".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH,
".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0,
".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0,
"*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH,
"??????????*", "123456789", 0, FNM_NOMATCH,
"*??????????", "123456789", 0, FNM_NOMATCH,
"*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0,
"??????????*", "1234567890", 0, 0,
"*??????????", "1234567890", 0, 0,
"*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0,
"??????????*", "12345678901", 0, 0,
"*??????????", "12345678901", 0, 0,
"[x]", "x", 0, 0,
"[*]", "*", 0, 0,
"[?]", "?", 0, 0,
"[", "[", 0, 0,
"[[]", "[", 0, 0,
"[[]", "x", 0, FNM_NOMATCH,
"[*]", "", 0, FNM_NOMATCH,
"[*]", "x", 0, FNM_NOMATCH,
"[?]", "x", 0, FNM_NOMATCH,
"*[*]*", "foo*foo", 0, 0,
"*[*]*", "foo", 0, FNM_NOMATCH,
"[0-9]", "0", 0, 0,
"[0-9]", "5", 0, 0,
"[0-9]", "9", 0, 0,
"[0-9]", "/", 0, FNM_NOMATCH,
"[0-9]", ":", 0, FNM_NOMATCH,
"[0-9]", "*", 0, FNM_NOMATCH,
"[!0-9]", "0", 0, FNM_NOMATCH,
"[!0-9]", "5", 0, FNM_NOMATCH,
"[!0-9]", "9", 0, FNM_NOMATCH,
"[!0-9]", "/", 0, 0,
"[!0-9]", ":", 0, 0,
"[!0-9]", "*", 0, 0,
"*[0-9]", "a0", 0, 0,
"*[0-9]", "a5", 0, 0,
"*[0-9]", "a9", 0, 0,
"*[0-9]", "a/", 0, FNM_NOMATCH,
"*[0-9]", "a:", 0, FNM_NOMATCH,
"*[0-9]", "a*", 0, FNM_NOMATCH,
"*[!0-9]", "a0", 0, FNM_NOMATCH,
"*[!0-9]", "a5", 0, FNM_NOMATCH,
"*[!0-9]", "a9", 0, FNM_NOMATCH,
"*[!0-9]", "a/", 0, 0,
"*[!0-9]", "a:", 0, 0,
"*[!0-9]", "a*", 0, 0,
"*[0-9]", "a00", 0, 0,
"*[0-9]", "a55", 0, 0,
"*[0-9]", "a99", 0, 0,
"*[0-9]", "a0a0", 0, 0,
"*[0-9]", "a5a5", 0, 0,
"*[0-9]", "a9a9", 0, 0,
"\\*", "*", 0, 0,
"\\?", "?", 0, 0,
"\\[x]", "[x]", 0, 0,
"\\[", "[", 0, 0,
"\\\\", "\\", 0, 0,
"*\\**", "foo*foo", 0, 0,
"*\\**", "foo", 0, FNM_NOMATCH,
"*\\\\*", "foo\\foo", 0, 0,
"*\\\\*", "foo", 0, FNM_NOMATCH,
"\\(", "(", 0, 0,
"\\a", "a", 0, 0,
"\\*", "a", 0, FNM_NOMATCH,
"\\?", "a", 0, FNM_NOMATCH,
"\\*", "\\*", 0, FNM_NOMATCH,
"\\?", "\\?", 0, FNM_NOMATCH,
"\\[x]", "\\[x]", 0, FNM_NOMATCH,
"\\[x]", "\\x", 0, FNM_NOMATCH,
"\\[", "\\[", 0, FNM_NOMATCH,
"\\(", "\\(", 0, FNM_NOMATCH,
"\\a", "\\a", 0, FNM_NOMATCH,
"\\", "\\", 0, FNM_NOMATCH,
"\\", "", 0, 0,
"\\*", "\\*", FNM_NOESCAPE, 0,
"\\?", "\\?", FNM_NOESCAPE, 0,
"\\", "\\", FNM_NOESCAPE, 0,
"\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH,
"\\\\", "\\\\", FNM_NOESCAPE, 0,
"*\\*", "foo\\foo", FNM_NOESCAPE, 0,
"*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH,
"*", ".", FNM_PERIOD, FNM_NOMATCH,
"?", ".", FNM_PERIOD, FNM_NOMATCH,
".*", ".", 0, 0,
".*", "..", 0, 0,
".*", ".a", 0, 0,
"[0-9]", ".", FNM_PERIOD, FNM_NOMATCH,
"a*", "a.", 0, 0,
"a/a", "a/a", FNM_PATHNAME, 0,
"a/*", "a/a", FNM_PATHNAME, 0,
"*/a", "a/a", FNM_PATHNAME, 0,
"*/*", "a/a", FNM_PATHNAME, 0,
"a*b/*", "abbb/x", FNM_PATHNAME, 0,
"a*b/*", "abbb/.x", FNM_PATHNAME, 0,
"*", "a/a", FNM_PATHNAME, FNM_NOMATCH,
"*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH,
"b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
"b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
"b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0,
"b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0,
"a", "A", FNM_CASEFOLD, 0,
"A", "a", FNM_CASEFOLD, 0,
"[a]", "A", FNM_CASEFOLD, 0,
"[A]", "a", FNM_CASEFOLD, 0,
"a", "b", FNM_CASEFOLD, FNM_NOMATCH,
"a", "a/b", FNM_PATHNAME, FNM_NOMATCH,
"*", "a/b", FNM_PATHNAME, FNM_NOMATCH,
"*b", "a/b", FNM_PATHNAME, FNM_NOMATCH,
"a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
"*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
"*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
"*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0,
"*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
"*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH,
"a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH,
{ "", "", 0, 0 },
{ "a", "a", 0, 0 },
{ "a", "b", 0, FNM_NOMATCH },
{ "a", "A", 0, FNM_NOMATCH },
{ "*", "a", 0, 0 },
{ "*", "aa", 0, 0 },
{ "*a", "a", 0, 0 },
{ "*a", "b", 0, FNM_NOMATCH },
{ "*a*", "b", 0, FNM_NOMATCH },
{ "*a*b*", "ab", 0, 0 },
{ "*a*b*", "qaqbq", 0, 0 },
{ "*a*bb*", "qaqbqbbq", 0, 0 },
{ "*a*bc*", "qaqbqbcq", 0, 0 },
{ "*a*bb*", "qaqbqbb", 0, 0 },
{ "*a*bc*", "qaqbqbc", 0, 0 },
{ "*a*bb", "qaqbqbb", 0, 0 },
{ "*a*bc", "qaqbqbc", 0, 0 },
{ "*a*bb", "qaqbqbbq", 0, FNM_NOMATCH },
{ "*a*bc", "qaqbqbcq", 0, FNM_NOMATCH },
{ "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaa", 0, FNM_NOMATCH },
{ "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaa", 0, 0 },
{ "*a*a*a*a*a*a*a*a*a*a*", "aaaaaaaaaaa", 0, 0 },
{ ".*.*.*.*.*.*.*.*.*.*", ".........", 0, FNM_NOMATCH },
{ ".*.*.*.*.*.*.*.*.*.*", "..........", 0, 0 },
{ ".*.*.*.*.*.*.*.*.*.*", "...........", 0, 0 },
{ "*?*?*?*?*?*?*?*?*?*?*", "123456789", 0, FNM_NOMATCH },
{ "??????????*", "123456789", 0, FNM_NOMATCH },
{ "*??????????", "123456789", 0, FNM_NOMATCH },
{ "*?*?*?*?*?*?*?*?*?*?*", "1234567890", 0, 0 },
{ "??????????*", "1234567890", 0, 0 },
{ "*??????????", "1234567890", 0, 0 },
{ "*?*?*?*?*?*?*?*?*?*?*", "12345678901", 0, 0 },
{ "??????????*", "12345678901", 0, 0 },
{ "*??????????", "12345678901", 0, 0 },
{ "[x]", "x", 0, 0 },
{ "[*]", "*", 0, 0 },
{ "[?]", "?", 0, 0 },
{ "[", "[", 0, 0 },
{ "[[]", "[", 0, 0 },
{ "[[]", "x", 0, FNM_NOMATCH },
{ "[*]", "", 0, FNM_NOMATCH },
{ "[*]", "x", 0, FNM_NOMATCH },
{ "[?]", "x", 0, FNM_NOMATCH },
{ "*[*]*", "foo*foo", 0, 0 },
{ "*[*]*", "foo", 0, FNM_NOMATCH },
{ "[0-9]", "0", 0, 0 },
{ "[0-9]", "5", 0, 0 },
{ "[0-9]", "9", 0, 0 },
{ "[0-9]", "/", 0, FNM_NOMATCH },
{ "[0-9]", ":", 0, FNM_NOMATCH },
{ "[0-9]", "*", 0, FNM_NOMATCH },
{ "[!0-9]", "0", 0, FNM_NOMATCH },
{ "[!0-9]", "5", 0, FNM_NOMATCH },
{ "[!0-9]", "9", 0, FNM_NOMATCH },
{ "[!0-9]", "/", 0, 0 },
{ "[!0-9]", ":", 0, 0 },
{ "[!0-9]", "*", 0, 0 },
{ "*[0-9]", "a0", 0, 0 },
{ "*[0-9]", "a5", 0, 0 },
{ "*[0-9]", "a9", 0, 0 },
{ "*[0-9]", "a/", 0, FNM_NOMATCH },
{ "*[0-9]", "a:", 0, FNM_NOMATCH },
{ "*[0-9]", "a*", 0, FNM_NOMATCH },
{ "*[!0-9]", "a0", 0, FNM_NOMATCH },
{ "*[!0-9]", "a5", 0, FNM_NOMATCH },
{ "*[!0-9]", "a9", 0, FNM_NOMATCH },
{ "*[!0-9]", "a/", 0, 0 },
{ "*[!0-9]", "a:", 0, 0 },
{ "*[!0-9]", "a*", 0, 0 },
{ "*[0-9]", "a00", 0, 0 },
{ "*[0-9]", "a55", 0, 0 },
{ "*[0-9]", "a99", 0, 0 },
{ "*[0-9]", "a0a0", 0, 0 },
{ "*[0-9]", "a5a5", 0, 0 },
{ "*[0-9]", "a9a9", 0, 0 },
{ "\\*", "*", 0, 0 },
{ "\\?", "?", 0, 0 },
{ "\\[x]", "[x]", 0, 0 },
{ "\\[", "[", 0, 0 },
{ "\\\\", "\\", 0, 0 },
{ "*\\**", "foo*foo", 0, 0 },
{ "*\\**", "foo", 0, FNM_NOMATCH },
{ "*\\\\*", "foo\\foo", 0, 0 },
{ "*\\\\*", "foo", 0, FNM_NOMATCH },
{ "\\(", "(", 0, 0 },
{ "\\a", "a", 0, 0 },
{ "\\*", "a", 0, FNM_NOMATCH },
{ "\\?", "a", 0, FNM_NOMATCH },
{ "\\*", "\\*", 0, FNM_NOMATCH },
{ "\\?", "\\?", 0, FNM_NOMATCH },
{ "\\[x]", "\\[x]", 0, FNM_NOMATCH },
{ "\\[x]", "\\x", 0, FNM_NOMATCH },
{ "\\[", "\\[", 0, FNM_NOMATCH },
{ "\\(", "\\(", 0, FNM_NOMATCH },
{ "\\a", "\\a", 0, FNM_NOMATCH },
{ "\\", "\\", 0, FNM_NOMATCH },
{ "\\", "", 0, 0 },
{ "\\*", "\\*", FNM_NOESCAPE, 0 },
{ "\\?", "\\?", FNM_NOESCAPE, 0 },
{ "\\", "\\", FNM_NOESCAPE, 0 },
{ "\\\\", "\\", FNM_NOESCAPE, FNM_NOMATCH },
{ "\\\\", "\\\\", FNM_NOESCAPE, 0 },
{ "*\\*", "foo\\foo", FNM_NOESCAPE, 0 },
{ "*\\*", "foo", FNM_NOESCAPE, FNM_NOMATCH },
{ "*", ".", FNM_PERIOD, FNM_NOMATCH },
{ "?", ".", FNM_PERIOD, FNM_NOMATCH },
{ ".*", ".", 0, 0 },
{ ".*", "..", 0, 0 },
{ ".*", ".a", 0, 0 },
{ "[0-9]", ".", FNM_PERIOD, FNM_NOMATCH },
{ "a*", "a.", 0, 0 },
{ "a/a", "a/a", FNM_PATHNAME, 0 },
{ "a/*", "a/a", FNM_PATHNAME, 0 },
{ "*/a", "a/a", FNM_PATHNAME, 0 },
{ "*/*", "a/a", FNM_PATHNAME, 0 },
{ "a*b/*", "abbb/x", FNM_PATHNAME, 0 },
{ "a*b/*", "abbb/.x", FNM_PATHNAME, 0 },
{ "*", "a/a", FNM_PATHNAME, FNM_NOMATCH },
{ "*/*", "a/a/a", FNM_PATHNAME, FNM_NOMATCH },
{ "b/*", "b/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH },
{ "b*/*", "a/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH },
{ "b/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0 },
{ "b*/.*", "b/.x", FNM_PATHNAME | FNM_PERIOD, 0 },
{ "a", "A", FNM_CASEFOLD, 0 },
{ "A", "a", FNM_CASEFOLD, 0 },
{ "[a]", "A", FNM_CASEFOLD, 0 },
{ "[A]", "a", FNM_CASEFOLD, 0 },
{ "a", "b", FNM_CASEFOLD, FNM_NOMATCH },
{ "a", "a/b", FNM_PATHNAME, FNM_NOMATCH },
{ "*", "a/b", FNM_PATHNAME, FNM_NOMATCH },
{ "*b", "a/b", FNM_PATHNAME, FNM_NOMATCH },
{ "a", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0 },
{ "*", "a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0 },
{ "*", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0 },
{ "*a", ".a/b", FNM_PATHNAME | FNM_LEADING_DIR, 0 },
{ "*", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH },
{ "*a", ".a/b", FNM_PATHNAME | FNM_PERIOD | FNM_LEADING_DIR, FNM_NOMATCH },
{ "a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD, FNM_NOMATCH },
};