Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e13ead69
Commit
e13ead69
authored
Nov 04, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Nov 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some ClearEventLog tests.
parent
9364d7a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
4 deletions
+63
-4
eventlog.c
dlls/advapi32/tests/eventlog.c
+63
-4
No files found.
dlls/advapi32/tests/eventlog.c
View file @
e13ead69
...
...
@@ -36,6 +36,16 @@ static void init_function_pointers(void)
pGetEventLogInformation
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"GetEventLogInformation"
);
}
static
void
create_backup
(
const
char
*
filename
)
{
HANDLE
handle
;
DeleteFileA
(
filename
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
BackupEventLogA
(
handle
,
filename
);
CloseEventLog
(
handle
);
}
static
void
test_open_close
(
void
)
{
HANDLE
handle
;
...
...
@@ -434,10 +444,7 @@ static void test_openbackup(void)
"Expected RPC_S_SERVER_UNAVAILABLE, got %d
\n
"
,
GetLastError
());
/* Make a backup eventlog to work with */
DeleteFileA
(
backup
);
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
BackupEventLogA
(
handle
,
backup
);
CloseEventLog
(
handle
);
create_backup
(
backup
);
/* FIXME: Wine stops here */
if
(
GetFileAttributesA
(
backup
)
==
INVALID_FILE_ATTRIBUTES
)
...
...
@@ -493,6 +500,57 @@ static void test_openbackup(void)
DeleteFileA
(
backup
);
}
static
void
test_clear
(
void
)
{
HANDLE
handle
;
BOOL
ret
;
const
char
backup
[]
=
"backup.evt"
;
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
NULL
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
/* Make a backup eventlog to work with */
create_backup
(
backup
);
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
NULL
,
backup
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
handle
=
OpenBackupEventLogA
(
NULL
,
backup
);
todo_wine
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
/* A real eventlog would fail with ERROR_ALREADY_EXISTS */
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
handle
,
backup
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
/* Show that ClearEventLog only works for real eventlogs. */
SetLastError
(
0xdeadbeef
);
ret
=
ClearEventLogA
(
handle
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
CloseEventLog
(
handle
);
DeleteFileA
(
backup
);
}
START_TEST
(
eventlog
)
{
SetLastError
(
0xdeadbeef
);
...
...
@@ -513,4 +571,5 @@ START_TEST(eventlog)
test_backup
();
test_openbackup
();
test_read
();
test_clear
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment