6 wchar_t *q = wcsstr(p, sub); \
8 t_error("wcsstr(%s,%s) returned str+%d, wanted 0\n", #s, #sub, q-p); \
11 #define T(s, sub, n) { \
13 wchar_t *q = wcsstr(p, sub); \
15 t_error("wcsstr(%s,%s) returned 0, wanted str+%d\n", #s, #sub, n); \
16 else if (q - p != n) \
17 t_error("wcsstr(%s,%s) returned str+%d, wanted str+%d\n", #s, #sub, q-p, n); \
28 N(L
"abc abc", L
"abcd")
29 N(L
"0-1-2-3-4-5-6-7-8-9", L
"-3-4-56-7-8-")
30 N(L
"0-1-2-3-4-5-6-7-8-9", L
"-3-4-5+6-7-8-")
31 N(L
"_ _ _\xff_ _ _", L
"_\x7f_")
32 N(L
"_ _ _\x7f_ _ _", L
"_\xff_")
43 T(L
"ababa", L
"baba", 1)
44 T(L
"ababab", L
"babab", 1)
45 T(L
"abababa", L
"bababa", 1)
46 T(L
"abababab", L
"bababab", 1)
47 T(L
"ababababa", L
"babababa", 1)
48 T(L
"abbababab", L
"bababa", 2)
49 T(L
"abbababab", L
"ababab", 3)
50 T(L
"abacabcabcab", L
"abcabcab", 4)
51 T(L
"nanabanabanana", L
"aba", 3)
52 T(L
"nanabanabanana", L
"ban", 4)
53 T(L
"nanabanabanana", L
"anab", 1)
54 T(L
"nanabanabanana", L
"banana", 8)
55 T(L
"_ _\xff_ _", L
"_\xff_", 2)