Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
a5807d08
Commit
a5807d08
authored
11 years ago
by
Bruno Jesus
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bcrypt/tests: Add tests for BCryptGenRandom.
parent
52aca431
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-0
1 addition, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
dlls/bcrypt/tests/Makefile.in
+5
-0
5 additions, 0 deletions
dlls/bcrypt/tests/Makefile.in
dlls/bcrypt/tests/bcrypt.c
+76
-0
76 additions, 0 deletions
dlls/bcrypt/tests/bcrypt.c
with
83 additions
and
0 deletions
configure
+
1
−
0
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
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
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])
...
...
This diff is collapsed.
Click to expand it.
dlls/bcrypt/tests/Makefile.in
0 → 100644
+
5
−
0
View file @
a5807d08
TESTDLL
=
bcrypt.dll
IMPORTS
=
user32
C_SRCS
=
\
bcrypt.c
This diff is collapsed.
Click to expand it.
dlls/bcrypt/tests/bcrypt.c
0 → 100644
+
76
−
0
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
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment