From: Theodoros Chatzigiannakis <tchatzigiannakis@gmail.com> --- dlls/msi/tests/db.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 26b5966bf43..2139c62c94a 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -9515,7 +9515,8 @@ static void test_table_mismatched_strref(void) WCHAR nameW[MAX_PATH], tmpW[MAX_PATH]; HRESULT hr; BYTE buf[4096], converted[4096]; - DWORD size, new_size; + char str[200]; + DWORD size, new_size, sz; const char *query; UINT r; @@ -9628,31 +9629,43 @@ static void test_table_mismatched_strref(void) r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - check_record(hrec, 2, "1", "one"); + sz = sizeof(str); + MsiRecordGetStringA(hrec, 2, str, &sz); + ok(!strcmp(str, "one") || broken(!*str), "Expected \"one\", got \"%s\"\n", str); MsiCloseHandle(hrec); r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - check_record(hrec, 2, "2", "two"); + sz = sizeof(str); + MsiRecordGetStringA(hrec, 2, str, &sz); + ok(!strcmp(str, "two") || broken(!*str), "Expected \"two\", got \"%s\"\n", str); MsiCloseHandle(hrec); r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - check_record(hrec, 2, "3", "three"); + sz = sizeof(str); + MsiRecordGetStringA(hrec, 2, str, &sz); + ok(!strcmp(str, "three") || broken(!*str), "Expected \"three\", got \"%s\"\n", str); MsiCloseHandle(hrec); r = MsiViewFetch(hview, &hrec); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - check_record(hrec, 2, "4", "four"); + sz = sizeof(str); + MsiRecordGetStringA(hrec, 2, str, &sz); + ok(!strcmp(str, "four") || broken(!*str), "Expected \"four\", got \"%s\"\n", str); MsiCloseHandle(hrec); r = MsiViewFetch(hview, &hrec); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - check_record(hrec, 2, "5", "five"); - MsiCloseHandle(hrec); + ok(r == ERROR_SUCCESS || broken(r == ERROR_NO_MORE_ITEMS), + "Expected ERROR_SUCCESS, got %d\n", r); + if (r == ERROR_SUCCESS) + { + check_record(hrec, 2, "5", "five"); + MsiCloseHandle(hrec); - r = MsiViewFetch(hview, &hrec); - ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); + r = MsiViewFetch(hview, &hrec); + ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r); + } MsiViewClose(hview); MsiCloseHandle(hview); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10114