Paul Vriens : advapi32/tests: Add some GetNumberOfEventLogRecords tests.

Alexandre Julliard julliard at winehq.org
Thu Oct 29 11:20:36 CDT 2009


Module: wine
Branch: master
Commit: 215ca8a4d748b9fc7371a06d413ac055009616d3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=215ca8a4d748b9fc7371a06d413ac055009616d3

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Oct 28 19:35:30 2009 +0100

advapi32/tests: Add some GetNumberOfEventLogRecords tests.

---

 dlls/advapi32/tests/eventlog.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/dlls/advapi32/tests/eventlog.c b/dlls/advapi32/tests/eventlog.c
index 628b08c..4840ec5 100644
--- a/dlls/advapi32/tests/eventlog.c
+++ b/dlls/advapi32/tests/eventlog.c
@@ -149,6 +149,44 @@ static void test_info(void)
     CloseEventLog(handle);
 }
 
+static void test_count(void)
+{
+    HANDLE handle;
+    BOOL ret;
+    DWORD count;
+
+    SetLastError(0xdeadbeef);
+    ret = GetNumberOfEventLogRecords(NULL, NULL);
+    ok(!ret, "Expected failure\n");
+    todo_wine
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+
+    SetLastError(0xdeadbeef);
+    count = 0xdeadbeef;
+    ret = GetNumberOfEventLogRecords(NULL, &count);
+    todo_wine
+    {
+    ok(!ret, "Expected failure\n");
+    ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
+    ok(count == 0xdeadbeef, "Expected count to stay unchanged\n");
+    }
+
+    handle = OpenEventLogA(NULL, "Application");
+
+    SetLastError(0xdeadbeef);
+    ret = GetNumberOfEventLogRecords(handle, NULL);
+    ok(!ret, "Expected failure\n");
+    todo_wine
+    ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
+
+    count = 0xdeadbeef;
+    ret = GetNumberOfEventLogRecords(handle, &count);
+    ok(ret, "Expected succes\n");
+    ok(count != 0xdeadbeef, "Expected the number of records\n");
+
+    CloseEventLog(handle);
+}
+
 START_TEST(eventlog)
 {
     SetLastError(0xdeadbeef);
@@ -164,4 +202,5 @@ START_TEST(eventlog)
     /* Parameters only */
     test_open_close();
     test_info();
+    test_count();
 }




More information about the wine-cvs mailing list