From 0bdab15b0f045dab33aede6b9732553191f83556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 12 Aug 2016 13:38:49 +0000 Subject: [PATCH] [ADVAPI32_APITEST]: Addendum to r72207: - Fix the tests so that they test what they have to test, on ReactOS & Windows 2k3/XP. (Note that here, ReactOS used the more restrained event size limitations of Vista+ compared to those of Win2k3. I choose to test, and will implement, the size limitations of Win2k3.) - Choose a different name for the test such that it doesn't collide with the 'eventlog' test from advapi32_winetest. CORE-11838 CORE-11839 svn path=/trunk/; revision=72209 --- rostests/apitests/advapi32/eventlog.c | 19 +++++++++---------- rostests/apitests/advapi32/testlist.c | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/rostests/apitests/advapi32/eventlog.c b/rostests/apitests/advapi32/eventlog.c index 4125ef6d4e3..c4aa9c08d3f 100644 --- a/rostests/apitests/advapi32/eventlog.c +++ b/rostests/apitests/advapi32/eventlog.c @@ -17,7 +17,7 @@ START_TEST(eventlog) /* Input */ ULONG MaxDataSize; - /* Output for Windows <= 2k3 / Windows Vista+ */ + /* Output for Windows <= 2k3 | Windows Vista+ (or "old" ReactOS) */ struct { BOOL Success; @@ -39,8 +39,8 @@ START_TEST(eventlog) { 0x3FF68, { {TRUE, ERROR_SUCCESS}, {FALSE, RPC_S_INVALID_BOUND} } }, /* Show that the maximum data size for an event can be as big as 0x3FFFF */ - { 0x3FFFE, { {TRUE, ERROR_SUCCESS /* or ERROR_INVALID_PARAMETER on Win2k3 */}, {FALSE, RPC_S_INVALID_BOUND} } }, - { 0x3FFFF, { {TRUE, ERROR_SUCCESS /* or ERROR_INVALID_PARAMETER on Win2k3 */}, {FALSE, RPC_S_INVALID_BOUND} } }, + { 0x3FFFE, { {TRUE, ERROR_SUCCESS /* or FALSE, ERROR_INVALID_PARAMETER on Win2k3 */}, {FALSE, RPC_S_INVALID_BOUND} } }, + { 0x3FFFF, { {TRUE, ERROR_SUCCESS /* or FALSE, ERROR_INVALID_PARAMETER on Win2k3 */}, {FALSE, RPC_S_INVALID_BOUND} } }, { 0x40000, { {FALSE, RPC_X_BAD_STUB_DATA}, {FALSE, RPC_S_INVALID_BOUND} } }, }; @@ -73,13 +73,12 @@ START_TEST(eventlog) if (LastError == ERROR_ENVVAR_NOT_FOUND) LastError = ERROR_SUCCESS; - ok((LastError == Tests[i].Result[0].LastError) || - broken(LastError == ERROR_INVALID_PARAMETER /* For Win2k3, see above */) || - broken(LastError == Tests[i].Result[1].LastError /* For Vista+ */), - "ReportEventW(%u) last error was %lu, expected %lu\n", i, LastError, Tests[i].Result[0].LastError); - - ok((Success == Tests[i].Result[0].Success) || broken(Success == Tests[i].Result[1].Success /* For Vista+ */), - "ReportEventW(%u) returned 0x%x, expected %s\n", i, Success, (Tests[i].Result[0].Success ? "TRUE" : "FALSE")); + ok( ( (Success == Tests[i].Result[0].Success) && (LastError == Tests[i].Result[0].LastError) ) || + broken( (Success == FALSE) && (LastError == ERROR_INVALID_PARAMETER) /* For Win2k3, see above */) // || + // broken( (Success == Tests[i].Result[1].Success) && (LastError == Tests[i].Result[1].LastError) /* For Vista+ */) + , + "ReportEventW(%u) returned 0x%x with last error %lu, expected %s with last error %lu\n", + i, Success, LastError, (Tests[i].Result[0].Success ? "TRUE" : "FALSE"), Tests[i].Result[0].LastError); HeapFree(GetProcessHeap(), 0, Data); } diff --git a/rostests/apitests/advapi32/testlist.c b/rostests/apitests/advapi32/testlist.c index 8ca23b987ee..a44cbb9ad1e 100644 --- a/rostests/apitests/advapi32/testlist.c +++ b/rostests/apitests/advapi32/testlist.c @@ -19,7 +19,7 @@ const struct test winetest_testlist[] = { { "CreateService", func_CreateService }, { "DuplicateTokenEx", func_DuplicateTokenEx }, - { "eventlog", func_eventlog }, + { "eventlog_supp", func_eventlog }, { "HKEY_CLASSES_ROOT", func_HKEY_CLASSES_ROOT }, { "IsTextUnicode" , func_IsTextUnicode }, { "LockDatabase" , func_LockDatabase },