advapi32/tests Fixed test macro in ConvertSecurityDescriptorToString

Marko Nikolic grkoma at gmail.com
Fri Jun 18 15:44:45 CDT 2010


There are two test macros that are used for testing
ConvertSecurityDescriptorToStringSecurityDescriptor function.

The first one, CHECK_RESULT_AND_FREE, is used for testing if the
expected string is the same as result stirng and if the lenght of
the strings are correct.

The second one, CHECK_ONE_OF_AND_FREE, should do the same for one of
the two expected strings. However, instead of checking lenght of the
resulted string against any of the expected strings it didn't
consider expected strings at all (instead it was just checking lenght
of result string and returned lenght).

This is corrected, so now lenght of resulted string is checked
against both expected strings.
---
 dlls/advapi32/tests/security.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index ba139ce..2b14ae5 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -2812,7 +2812,7 @@ static void test_ConvertSecurityDescriptorToString(void)
 
 #define CHECK_ONE_OF_AND_FREE(exp_str1, exp_str2) \
     ok(strcmp(string, (exp_str1)) == 0 || strcmp(string, (exp_str2)) == 0, "String mismatch (expected\n\"%s\" or\n\"%s\", got\n\"%s\")\n", (exp_str1), (exp_str2), string); \
-    ok(len >= (strlen(string) + 1), "Length mismatch (expected %d, got %d)\n", lstrlen(string) + 1, len); \
+    ok(len >= (strlen(exp_str1) + 1) || len >= (strlen(exp_str2) + 1), "Length mismatch (expected %d or %d, got %d)\n", lstrlen(exp_str1) + 1, lstrlen(exp_str2) + 1, len); \
     LocalFree(string);
 
     InitializeSecurityDescriptor(&desc, SECURITY_DESCRIPTOR_REVISION);
-- 
1.7.0.4




More information about the wine-patches mailing list