Piotr Caban : msvcrt/tests: Remove strcmp_space helper.

Alexandre Julliard julliard at winehq.org
Fri Apr 30 16:03:29 CDT 2021


Module: wine
Branch: master
Commit: fd50524e1da5467c2d427af2f7725e879b25a97d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=fd50524e1da5467c2d427af2f7725e879b25a97d

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Apr 30 20:50:53 2021 +0200

msvcrt/tests: Remove strcmp_space helper.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/tests/cpp.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c
index bf2e9c2c42a..e9dccf3cb82 100644
--- a/dlls/msvcrt/tests/cpp.c
+++ b/dlls/msvcrt/tests/cpp.c
@@ -1100,25 +1100,6 @@ static void test_demangle_datatype(void)
     }
 }
 
-/* Compare two strings treating multiple spaces (' ', ascii 0x20) in s2 
-   as single space. Needed for test_demangle as __unDName() returns sometimes
-   two spaces instead of one in some older native msvcrt dlls. */
-static int strcmp_space(const char *s1, const char *s2)
-{
-    const char* s2start = s2;
-    do {
-        while (*s1 == *s2 && *s1) {
-            s1++;
-            s2++;
-        }
-        if (*s2 == ' ' && s2 > s2start && *(s2 - 1) == ' ')
-            s2++;
-        else
-            break;
-    } while (*s1 && *s2);
-    return *s1 - *s2;
-}
-
 static void test_demangle(void)
 {
     static struct {const char* in; const char* out; const char *broken; unsigned int flags;} test[] = {
@@ -1314,11 +1295,11 @@ static void test_demangle(void)
 	name = p__unDName(0, test[i].in, 0, malloc, free, test[i].flags);
         ok(name != NULL, "%u: unDName failed\n", i);
         if (!name) continue;
-        ok( !strcmp_space(test[i].out, name) ||
-            broken(test[i].broken && !strcmp_space(test[i].broken, name)),
+        ok( !strcmp(test[i].out, name) ||
+            broken(test[i].broken && !strcmp(test[i].broken, name)),
            "%u: Got name \"%s\"\n", i, name );
-        ok( !strcmp_space(test[i].out, name) ||
-            broken(test[i].broken && !strcmp_space(test[i].broken, name)),
+        ok( !strcmp(test[i].out, name) ||
+            broken(test[i].broken && !strcmp(test[i].broken, name)),
            "%u: Expected \"%s\"\n", i, test[i].out );
         free(name);
     }




More information about the wine-cvs mailing list