advapi32/tests: Add some GetNumberOfEventLogRecords tests.
This commit is contained in:
parent
11651f5731
commit
215ca8a4d7
|
@ -149,6 +149,44 @@ static void test_info(void)
|
||||||
CloseEventLog(handle);
|
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)
|
START_TEST(eventlog)
|
||||||
{
|
{
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
|
@ -164,4 +202,5 @@ START_TEST(eventlog)
|
||||||
/* Parameters only */
|
/* Parameters only */
|
||||||
test_open_close();
|
test_open_close();
|
||||||
test_info();
|
test_info();
|
||||||
|
test_count();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue