https://git.reactos.org/?p=reactos.git;a=commitdiff;h=286d460b45b7d9fcacc41…
commit 286d460b45b7d9fcacc4125d1ba3a4daf411b543
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Fri Jan 12 12:58:27 2024 -0500
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Fri Jan 12 12:58:27 2024 -0500
[CRTDLL_APITEST] Oops. Fix that other compiler. CORE-16933
---
modules/rostests/apitests/crt/_mbsncmp.c | 20 ++++++-------
modules/rostests/apitests/crt/_mbsstr.c | 48 ++++++++++++++++----------------
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/modules/rostests/apitests/crt/_mbsncmp.c
b/modules/rostests/apitests/crt/_mbsncmp.c
index 7aa099cde3c..836f19afd85 100644
--- a/modules/rostests/apitests/crt/_mbsncmp.c
+++ b/modules/rostests/apitests/crt/_mbsncmp.c
@@ -33,38 +33,38 @@ START_TEST(_mbsncmp)
ret = _mbsncmp(NULL, NULL, 0);
ok(ret == 0, "ret = %d\n", ret);
- ret = _mbsncmp("a", "c", 0);
+ ret = _mbsncmp((const unsigned char *)"a", (const unsigned char
*)"c", 0);
ok(ret == 0, "ret = %d\n", ret);
/* No null checks - length 1 crashes */
StartSeh()
- (void)_mbsncmp("a", NULL, 1);
+ (void)_mbsncmp((const unsigned char *)"a", NULL, 1);
EndSeh(STATUS_ACCESS_VIOLATION);
StartSeh()
- (void)_mbsncmp(NULL, "c", 1);
+ (void)_mbsncmp(NULL, (const unsigned char *)"c", 1);
EndSeh(STATUS_ACCESS_VIOLATION);
/* Strings longer than or equal to length */
- ret = _mbsncmp("a", "c", 1);
+ ret = _mbsncmp((const unsigned char *)"a", (const unsigned char
*)"c", 1);
ok(ret == DIFF_RETURN(-, 2), "ret = %d\n", ret);
- ret = _mbsncmp("a", "a", 1);
+ ret = _mbsncmp((const unsigned char *)"a", (const unsigned char
*)"a", 1);
ok(ret == 0, "ret = %d\n", ret);
- ret = _mbsncmp("ab", "aB", 1);
+ ret = _mbsncmp((const unsigned char *)"ab", (const unsigned char
*)"aB", 1);
ok(ret == 0, "ret = %d\n", ret);
- ret = _mbsncmp("aa", "ac", 2);
+ ret = _mbsncmp((const unsigned char *)"aa", (const unsigned char
*)"ac", 2);
ok(ret == DIFF_RETURN(-, 2), "ret = %d\n", ret);
/* Length longer than one of the strings */
- ret = _mbsncmp("a", "ac", 2);
+ ret = _mbsncmp((const unsigned char *)"a", (const unsigned char
*)"ac", 2);
ok(ret == DIFF_RETURN(-, 'c'), "ret = %d\n", ret);
- ret = _mbsncmp("aa", "a", 2);
+ ret = _mbsncmp((const unsigned char *)"aa", (const unsigned char
*)"a", 2);
ok(ret == DIFF_RETURN(+, 'a'), "ret = %d\n", ret);
- ret = _mbsncmp("ab", "ab", 100);
+ ret = _mbsncmp((const unsigned char *)"ab", (const unsigned char
*)"ab", 100);
ok(ret == 0, "ret = %d\n", ret);
}
diff --git a/modules/rostests/apitests/crt/_mbsstr.c
b/modules/rostests/apitests/crt/_mbsstr.c
index fc926c1cee8..d06d6184ec4 100644
--- a/modules/rostests/apitests/crt/_mbsstr.c
+++ b/modules/rostests/apitests/crt/_mbsstr.c
@@ -22,27 +22,27 @@ START_TEST(_mbsstr)
EndSeh(STATUS_ACCESS_VIOLATION);
StartSeh()
- haystack = "hello";
+ haystack = (unsigned char *)"hello";
(void)_mbsstr(haystack, NULL);
EndSeh(STATUS_ACCESS_VIOLATION);
StartSeh()
- haystack = "";
+ haystack = (unsigned char *)"";
(void)_mbsstr(haystack, NULL);
EndSeh(STATUS_ACCESS_VIOLATION);
/* Empty needle returns haystack, empty haystack returns NULL... */
- haystack = "hello";
- ret = _mbsstr(haystack, "");
+ haystack = (unsigned char *)"hello";
+ ret = _mbsstr(haystack, (const unsigned char *)"");
ok(ret == haystack, "ret = %p, haystack = %p\n", ret, haystack);
- haystack = "";
- ret = _mbsstr(haystack, "a");
+ haystack = (unsigned char *)"";
+ ret = _mbsstr(haystack, (const unsigned char *)"a");
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
/* ... but if both are empty, behavior differs */
- haystack = "";
- ret = _mbsstr(haystack, "");
+ haystack = (unsigned char *)"";
+ ret = _mbsstr(haystack, (const unsigned char *)"");
#ifdef TEST_CRTDLL
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
#else
@@ -50,38 +50,38 @@ START_TEST(_mbsstr)
#endif
/* Simple "found" cases */
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "abc");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"abc");
ok(ret == haystack, "ret = %p, haystack = %p\n", ret, haystack);
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "g");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"g");
ok(ret == haystack + 6, "ret = %p, haystack = %p\n", ret, haystack);
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "abcdefg");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"abcdefg");
ok(ret == haystack, "ret = %p, haystack = %p\n", ret, haystack);
/* Simple "not found" cases */
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "h");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"h");
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "gh");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"gh");
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "abcD");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"abcD");
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
/* Needle longer than haystack */
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "abcdefgh");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"abcdefgh");
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
- haystack = "abcdefg";
- ret = _mbsstr(haystack, "xxxxxxxx");
+ haystack = (unsigned char *)"abcdefg";
+ ret = _mbsstr(haystack, (const unsigned char *)"xxxxxxxx");
ok(ret == NULL, "ret = %p, haystack = %p\n", ret, haystack);
}