Commit 13e81421 authored by Carlos Rivera's avatar Carlos Rivera Committed by Alexandre Julliard

kernel32/tests: Use debugstr_an to show contents of buffer.

In the tests modified the buffer to show is expected to contain strings separated by \0. So that passing the buffer to the ok macro will only print the first string. Showing the whole returned buffer gives more information when the test fails. Signed-off-by: 's avatarCarlos Rivera <carlos@superkaos.org> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8aa370e9
......@@ -591,8 +591,10 @@ static void test_GetPrivateProfileString(const char *content, const char *descri
buf, MAX_PATH, filename);
ok(ret == 18, "Expected 18, got %d\n", ret);
len = lstrlenA("section1") + sizeof(CHAR) + lstrlenA("section2") + 2 * sizeof(CHAR);
ok(!memcmp(buf, "section1\0section2\0\0", len),
"Expected \"section1\\0section2\\0\\0\", got \"%s\"\n", buf);
ok(!memcmp(buf, "section1\0section2\0", len),
"Expected \"section1\\x00section2\\x00\\x00\", got %s\n",
debugstr_an(buf, (ret + 2 >= MAX_PATH ? MAX_PATH : ret + 1)));
/* lpAppName is empty */
memset(buf, 0xc, sizeof(buf));
......@@ -667,7 +669,8 @@ static void test_GetPrivateProfileString(const char *content, const char *descri
buf, MAX_PATH, filename);
ok(ret == 18, "Expected 18, got %d\n", ret);
ok(!memcmp(buf, "name1\0name2\0name4\0", ret + 1),
"Expected \"name1\\0name2\\0name4\\0\", got \"%s\"\n", buf);
"Expected \"name1\\x00name2\\x00name4\\x00\\x00\", got %s\n",
debugstr_an(buf, (ret + 2 >= MAX_PATH ? MAX_PATH : ret + 1)));
/* lpKeyName is empty */
memset(buf, 0xc,sizeof(buf));
......@@ -794,8 +797,9 @@ static void test_GetPrivateProfileString(const char *content, const char *descri
ok(ret == 14, "Expected 14, got %d\n", ret);
len = lstrlenA("section1") + 2 * sizeof(CHAR);
todo_wine
ok(!memcmp(buf, "section1\0secti\0\0", ret + 2),
"Expected \"section1\\0secti\\0\\0\", got \"%s\"\n", buf);
ok(!memcmp(buf, "section1\0secti\0", ret + 2),
"Expected \"section1\\x00secti\\x00\\x00\", got %s\n",
debugstr_an(buf, (ret + 2 >= 16 ? 16 : ret + 1)));
/* lpKeyName is NULL, not enough room for final key name */
memset(buf, 0xc,sizeof(buf));
......@@ -804,8 +808,9 @@ static void test_GetPrivateProfileString(const char *content, const char *descri
buf, 16, filename);
ok(ret == 14, "Expected 14, got %d\n", ret);
todo_wine
ok(!memcmp(buf, "name1\0name2\0na\0\0", ret + 2),
"Expected \"name1\\0name2\\0na\\0\\0\", got \"%s\"\n", buf);
ok(!memcmp(buf, "name1\0name2\0na\0", ret + 2),
"Expected \"name1\\x00name2\\x00na\\x00\\x00\", got %s\n",
debugstr_an(buf, (ret + 2 >= 16 ? 16 : ret + 1)));
/* key value has quotation marks which are stripped */
memset(buf, 0xc,sizeof(buf));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment