Module: wine Branch: master Commit: 00193610f0e96f7e1fa28f045bf24c4ff1bda53b URL: http://source.winehq.org/git/wine.git/?a=commit;h=00193610f0e96f7e1fa28f045b...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Oct 17 14:15:40 2007 +0200
kernel32/tests: Replace a couple of macros by a function to avoid compiler warnings.
---
dlls/kernel32/tests/process.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index a5f240a..43d6ac0 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -424,17 +424,16 @@ static int strCmp(const char* s1, const char* s2, BOOL sensitive) return (sensitive) ? strcmp(s1, s2) : wtstrcasecmp(s1, s2); }
-#define okChildString(sect, key, expect) \ - do { \ - char* result = getChildString((sect), (key)); \ - ok(strCmp(result, expect, 1) == 0, "%s:%s expected '%s', got '%s'\n", (sect), (key), (expect)?(expect):"(null)", result); \ - } while (0) +static void ok_child_string( int line, const char *sect, const char *key, + const char *expect, int sensitive ) +{ + char* result = getChildString( sect, key ); + ok_(__FILE__, line)( strCmp(result, expect, sensitive) == 0, "%s:%s expected '%s', got '%s'\n", + sect, key, expect ? expect : "(null)", result ); +}
-#define okChildIString(sect, key, expect) \ - do { \ - char* result = getChildString(sect, key); \ - ok(strCmp(result, expect, 0) == 0, "%s:%s expected '%s', got '%s'\n", sect, key, expect, result); \ - } while (0) +#define okChildString(sect, key, expect) ok_child_string(__LINE__, (sect), (key), (expect), 1 ) +#define okChildIString(sect, key, expect) ok_child_string(__LINE__, (sect), (key), (expect), 0 )
/* using !expect ensures that the test will fail if the sect/key isn't present * in result file