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
48033db6
Commit
48033db6
authored
Oct 26, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
Oct 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add some basic eventlog tests.
parent
e606da3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
0 deletions
+103
-0
Makefile.in
dlls/advapi32/tests/Makefile.in
+1
-0
eventlog.c
dlls/advapi32/tests/eventlog.c
+102
-0
No files found.
dlls/advapi32/tests/Makefile.in
View file @
48033db6
...
...
@@ -12,6 +12,7 @@ CTESTS = \
crypt_md4.c
\
crypt_md5.c
\
crypt_sha.c
\
eventlog.c
\
lsa.c
\
registry.c
\
security.c
\
...
...
dlls/advapi32/tests/eventlog.c
0 → 100644
View file @
48033db6
/*
* Unit tests for Event Logging functions
*
* Copyright (c) 2009 Paul Vriens
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnt.h"
#include "wine/test.h"
static
void
test_open_close
(
void
)
{
HANDLE
handle
;
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
CloseEventLog
(
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
||
GetLastError
()
==
ERROR_NOACCESS
,
/* W2K */
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
NULL
,
NULL
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
"IDontExist"
,
NULL
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
handle
=
OpenEventLogA
(
"IDontExist"
,
"deadbeef"
);
todo_wine
{
ok
(
handle
==
NULL
,
"Didn't expect a handle
\n
"
);
ok
(
GetLastError
()
==
RPC_S_SERVER_UNAVAILABLE
||
GetLastError
()
==
RPC_S_INVALID_NET_ADDR
,
/* Some Vista and Win7 */
"Expected RPC_S_SERVER_UNAVAILABLE, got %d
\n
"
,
GetLastError
());
}
/* This one opens the Application log */
handle
=
OpenEventLogA
(
NULL
,
"deadbeef"
);
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
ret
=
CloseEventLog
(
handle
);
ok
(
ret
,
"Expected success
\n
"
);
/* Close a second time */
SetLastError
(
0xdeadbeef
);
ret
=
CloseEventLog
(
handle
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
}
handle
=
OpenEventLogA
(
NULL
,
"Application"
);
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
CloseEventLog
(
handle
);
}
START_TEST
(
eventlog
)
{
SetLastError
(
0xdeadbeef
);
CloseEventLog
(
NULL
);
if
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
{
win_skip
(
"Event log functions are not implemented
\n
"
);
return
;
}
/* Parameters only */
test_open_close
();
}
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