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
a5807d08
Commit
a5807d08
authored
Feb 03, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Feb 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt/tests: Add tests for BCryptGenRandom.
parent
52aca431
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
0 deletions
+83
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/bcrypt/tests/Makefile.in
+5
-0
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
+76
-0
No files found.
configure
View file @
a5807d08
...
...
@@ -16653,6 +16653,7 @@ wine_fn_config_test dlls/avifil32/tests avifil32_test
wine_fn_config_dll avifile.dll16 enable_win16
wine_fn_config_dll avrt enable_avrt implib
wine_fn_config_dll bcrypt enable_bcrypt
wine_fn_config_test dlls/bcrypt/tests bcrypt_test
wine_fn_config_dll browseui enable_browseui clean,po
wine_fn_config_test dlls/browseui/tests browseui_test
wine_fn_config_dll cabinet enable_cabinet implib
...
...
configure.ac
View file @
a5807d08
...
...
@@ -2678,6 +2678,7 @@ WINE_CONFIG_TEST(dlls/avifil32/tests)
WINE_CONFIG_DLL(avifile.dll16,enable_win16)
WINE_CONFIG_DLL(avrt,,[implib])
WINE_CONFIG_DLL(bcrypt)
WINE_CONFIG_TEST(dlls/bcrypt/tests)
WINE_CONFIG_DLL(browseui,,[clean,po])
WINE_CONFIG_TEST(dlls/browseui/tests)
WINE_CONFIG_DLL(cabinet,,[implib])
...
...
dlls/bcrypt/tests/Makefile.in
0 → 100644
View file @
a5807d08
TESTDLL
=
bcrypt.dll
IMPORTS
=
user32
C_SRCS
=
\
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
0 → 100644
View file @
a5807d08
/*
* Unit test for bcrypt functions
*
* Copyright 2014 Bruno Jesus
*
* 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 <ntstatus.h>
#define WIN32_NO_STATUS
#include <windows.h>
#include <bcrypt.h>
#include "wine/test.h"
static
NTSTATUS
(
WINAPI
*
pBCryptGenRandom
)(
BCRYPT_ALG_HANDLE
hAlgorithm
,
PUCHAR
pbBuffer
,
ULONG
cbBuffer
,
ULONG
dwFlags
);
static
BOOL
Init
(
void
)
{
HMODULE
hbcrypt
=
LoadLibraryA
(
"bcrypt.dll"
);
if
(
!
hbcrypt
)
{
win_skip
(
"bcrypt library not available
\n
"
);
return
FALSE
;
}
pBCryptGenRandom
=
(
void
*
)
GetProcAddress
(
hbcrypt
,
"BCryptGenRandom"
);
return
TRUE
;
}
static
void
test_BCryptGenRandom
(
void
)
{
NTSTATUS
ret
;
UCHAR
buffer
[
256
];
if
(
!
pBCryptGenRandom
)
{
win_skip
(
"BCryptGenRandom is not available
\n
"
);
return
;
}
todo_wine
{
ret
=
pBCryptGenRandom
(
NULL
,
NULL
,
0
,
0
);
ok
(
ret
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got 0x%x
\n
"
,
ret
);
ret
=
pBCryptGenRandom
(
NULL
,
buffer
,
0
,
0
);
ok
(
ret
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got 0x%x
\n
"
,
ret
);
ret
=
pBCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
0
);
ok
(
ret
==
STATUS_INVALID_HANDLE
,
"Expected STATUS_INVALID_HANDLE, got 0x%x
\n
"
,
ret
);
ret
=
pBCryptGenRandom
(
NULL
,
buffer
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ok
(
ret
==
STATUS_SUCCESS
,
"Expected success, got 0x%x
\n
"
,
ret
);
ret
=
pBCryptGenRandom
(
NULL
,
NULL
,
sizeof
(
buffer
),
BCRYPT_USE_SYSTEM_PREFERRED_RNG
);
ok
(
ret
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got 0x%x
\n
"
,
ret
);
}
}
START_TEST
(
bcrypt
)
{
if
(
!
Init
())
return
;
test_BCryptGenRandom
();
}
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