Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
39081ddc
Commit
39081ddc
authored
Feb 07, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Feb 07, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trailing '\n's to ok() calls.
parent
f083d700
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
70 deletions
+70
-70
env.c
dlls/ntdll/tests/env.c
+20
-20
error.c
dlls/ntdll/tests/error.c
+4
-4
large_int.c
dlls/ntdll/tests/large_int.c
+13
-13
path.c
dlls/ntdll/tests/path.c
+6
-6
rtl.c
dlls/ntdll/tests/rtl.c
+27
-27
rtlstr.c
dlls/ntdll/tests/rtlstr.c
+0
-0
string.c
dlls/ntdll/tests/string.c
+0
-0
No files found.
dlls/ntdll/tests/env.c
View file @
39081ddc
...
...
@@ -106,22 +106,22 @@ static void testQuery(void)
pRtlMultiByteToUnicodeN
(
bn
,
sizeof
(
bn
),
NULL
,
test
->
var
,
strlen
(
test
->
var
)
+
1
);
nts
=
pRtlQueryEnvironmentVariable_U
(
small_env
,
&
name
,
&
value
);
ok
(
nts
==
test
->
status
,
"[%d]: Wrong status for '%s', expecting %lx got %lx"
,
ok
(
nts
==
test
->
status
,
"[%d]: Wrong status for '%s', expecting %lx got %lx
\n
"
,
test
-
tests
,
test
->
var
,
test
->
status
,
nts
);
if
(
nts
==
test
->
status
)
switch
(
nts
)
{
case
STATUS_SUCCESS
:
pRtlMultiByteToUnicodeN
(
bn
,
sizeof
(
bn
),
NULL
,
test
->
val
,
strlen
(
test
->
val
)
+
1
);
ok
(
value
.
Length
==
strlen
(
test
->
val
)
*
sizeof
(
WCHAR
),
"Wrong length %d/%d for %s"
,
ok
(
value
.
Length
==
strlen
(
test
->
val
)
*
sizeof
(
WCHAR
),
"Wrong length %d/%d for %s
\n
"
,
value
.
Length
,
strlen
(
test
->
val
)
*
sizeof
(
WCHAR
),
test
->
var
);
ok
((
value
.
Length
==
strlen
(
test
->
val
)
*
sizeof
(
WCHAR
)
&&
strncmpW
(
bv
,
bn
,
test
->
len
)
==
0
)
||
strcmpW
(
bv
,
bn
)
==
0
,
"Wrong result for %s/%d"
,
test
->
var
,
test
->
len
);
ok
(
bv
[
test
->
len
]
==
'@'
,
"Writing too far away in the buffer for %s/%d"
,
test
->
var
,
test
->
len
);
"Wrong result for %s/%d
\n
"
,
test
->
var
,
test
->
len
);
ok
(
bv
[
test
->
len
]
==
'@'
,
"Writing too far away in the buffer for %s/%d
\n
"
,
test
->
var
,
test
->
len
);
break
;
case
STATUS_BUFFER_TOO_SMALL
:
ok
(
value
.
Length
==
strlen
(
test
->
val
)
*
sizeof
(
WCHAR
),
"Wrong returned length %d/%d (too small buffer) for %s"
,
"Wrong returned length %d/%d (too small buffer) for %s
\n
"
,
value
.
Length
,
strlen
(
test
->
val
)
*
sizeof
(
WCHAR
),
test
->
var
);
break
;
}
...
...
@@ -147,7 +147,7 @@ static void testSetHelper(LPWSTR* env, const char* var, const char* val, NTSTATU
pRtlMultiByteToUnicodeN
(
bval1
,
sizeof
(
bval1
),
NULL
,
val
,
strlen
(
val
)
+
1
);
}
nts
=
pRtlSetEnvironmentVariable
(
env
,
&
uvar
,
val
?
&
uval
:
NULL
);
ok
(
nts
==
ret
,
"Setting var %s=%s (%lx/%lx)"
,
var
,
val
,
nts
,
ret
);
ok
(
nts
==
ret
,
"Setting var %s=%s (%lx/%lx)
\n
"
,
var
,
val
,
nts
,
ret
);
if
(
nts
==
STATUS_SUCCESS
)
{
uval
.
Length
=
0
;
...
...
@@ -157,13 +157,13 @@ static void testSetHelper(LPWSTR* env, const char* var, const char* val, NTSTATU
switch
(
nts
)
{
case
STATUS_SUCCESS
:
ok
(
strcmpW
(
bval1
,
bval2
)
==
0
,
"Cannot get value written to environment"
);
ok
(
strcmpW
(
bval1
,
bval2
)
==
0
,
"Cannot get value written to environment
\n
"
);
break
;
case
STATUS_VARIABLE_NOT_FOUND
:
ok
(
val
==
NULL
,
"Couldn't find variable, but didn't delete it"
);
ok
(
val
==
NULL
,
"Couldn't find variable, but didn't delete it
\n
"
);
break
;
default:
ok
(
0
,
"Wrong ret %lu for %s"
,
nts
,
var
);
ok
(
0
,
"Wrong ret %lu for %s
\n
"
,
nts
,
var
);
break
;
}
}
...
...
@@ -175,7 +175,7 @@ static void testSet(void)
char
tmp
[
16
];
int
i
;
ok
(
pRtlCreateEnvironment
(
FALSE
,
&
env
)
==
STATUS_SUCCESS
,
"Creating environment"
);
ok
(
pRtlCreateEnvironment
(
FALSE
,
&
env
)
==
STATUS_SUCCESS
,
"Creating environment
\n
"
);
memmove
(
env
,
small_env
,
sizeof
(
small_env
));
testSetHelper
(
&
env
,
"cat"
,
"dog"
,
STATUS_SUCCESS
);
...
...
@@ -202,7 +202,7 @@ static void testSet(void)
}
testSetHelper
(
&
env
,
"fOo"
,
NULL
,
STATUS_SUCCESS
);
ok
(
pRtlDestroyEnvironment
(
env
)
==
STATUS_SUCCESS
,
"Destroying environment"
);
ok
(
pRtlDestroyEnvironment
(
env
)
==
STATUS_SUCCESS
,
"Destroying environment
\n
"
);
}
static
void
testExpand
(
void
)
...
...
@@ -248,7 +248,7 @@ static void testExpand(void)
nts
=
pRtlExpandEnvironmentStrings_U
(
small_env
,
&
us_src
,
&
us_dst
,
&
ul
);
ok
(
ul
==
strlen
(
test
->
dst
)
*
sizeof
(
WCHAR
)
+
sizeof
(
WCHAR
),
"Wrong returned length for %s: %lu <> %u
"
,
"Wrong returned length for %s: %lu <> %u
\n
"
,
test
->
src
,
ul
,
strlen
(
test
->
dst
)
*
sizeof
(
WCHAR
)
+
sizeof
(
WCHAR
));
us_dst
.
Length
=
0
;
...
...
@@ -256,14 +256,14 @@ static void testExpand(void)
us_dst
.
Buffer
=
dst
;
nts
=
pRtlExpandEnvironmentStrings_U
(
small_env
,
&
us_src
,
&
us_dst
,
&
ul
);
ok
(
nts
==
STATUS_SUCCESS
,
"Call failed (%lu)"
,
nts
);
ok
(
nts
==
STATUS_SUCCESS
,
"Call failed (%lu)
\n
"
,
nts
);
ok
(
ul
==
us_dst
.
Length
+
sizeof
(
WCHAR
),
"Wrong returned length for %s: %lu <> %u
"
,
"Wrong returned length for %s: %lu <> %u
\n
"
,
test
->
src
,
ul
,
us_dst
.
Length
+
sizeof
(
WCHAR
));
ok
(
ul
==
strlen
(
test
->
dst
)
*
sizeof
(
WCHAR
)
+
sizeof
(
WCHAR
),
"Wrong returned length for %s: %lu <> %u
"
,
"Wrong returned length for %s: %lu <> %u
\n
"
,
test
->
src
,
ul
,
strlen
(
test
->
dst
)
*
sizeof
(
WCHAR
)
+
sizeof
(
WCHAR
));
ok
(
strcmpW
(
dst
,
rst
)
==
0
,
"Wrong result for %s: expecting %s
"
,
ok
(
strcmpW
(
dst
,
rst
)
==
0
,
"Wrong result for %s: expecting %s
\n
"
,
test
->
src
,
test
->
dst
);
us_dst
.
Length
=
0
;
...
...
@@ -271,14 +271,14 @@ static void testExpand(void)
us_dst
.
Buffer
=
dst
;
dst
[
8
]
=
'-'
;
nts
=
pRtlExpandEnvironmentStrings_U
(
small_env
,
&
us_src
,
&
us_dst
,
&
ul
);
ok
(
nts
==
STATUS_BUFFER_TOO_SMALL
,
"Call failed (%lu)"
,
nts
);
ok
(
nts
==
STATUS_BUFFER_TOO_SMALL
,
"Call failed (%lu)
\n
"
,
nts
);
ok
(
ul
==
strlen
(
test
->
dst
)
*
sizeof
(
WCHAR
)
+
sizeof
(
WCHAR
),
"Wrong returned length for %s (with buffer too small): %lu <> %u
"
,
"Wrong returned length for %s (with buffer too small): %lu <> %u
\n
"
,
test
->
src
,
ul
,
strlen
(
test
->
dst
)
*
sizeof
(
WCHAR
)
+
sizeof
(
WCHAR
));
ok
(
strncmpW
(
dst
,
rst
,
8
)
==
0
,
"Wrong result for %s (with buffer too small): expecting %s
"
,
"Wrong result for %s (with buffer too small): expecting %s
\n
"
,
test
->
src
,
test
->
dst
);
ok
(
dst
[
8
]
==
'-'
,
"Writing too far in buffer (got %c/%d)"
,
dst
[
8
],
dst
[
8
]);
ok
(
dst
[
8
]
==
'-'
,
"Writing too far in buffer (got %c/%d)
\n
"
,
dst
[
8
],
dst
[
8
]);
}
}
...
...
dlls/ntdll/tests/error.c
View file @
39081ddc
...
...
@@ -72,7 +72,7 @@ static void cmp_call(NTSTATUS win_nt, ULONG win32, const char* message)
err
=
statustodoserror
(
win_nt
);
ok
(
err
==
win32
,
"%s (%lx): got %ld, expected %ld"
,
"%s (%lx): got %ld, expected %ld
\n
"
,
message
,
win_nt
,
err
,
win32
);
}
...
...
@@ -83,7 +83,7 @@ static void cmp_call2(NTSTATUS win_nt, ULONG win32, const char* message)
err
=
statustodoserror
(
win_nt
);
ok
(
err
==
win32
||
(
!
strict
&&
err
==
ERROR_MR_MID_NOT_FOUND
),
"%s (%lx): got %ld, expected %ld (or MID_NOT_FOUND)"
,
"%s (%lx): got %ld, expected %ld (or MID_NOT_FOUND)
\n
"
,
message
,
win_nt
,
err
,
win32
);
}
...
...
@@ -93,7 +93,7 @@ static void cmp_call3(NTSTATUS win_nt, ULONG win32_1, ULONG win32_2, const char*
err
=
statustodoserror
(
win_nt
);
ok
(
err
==
win32_1
||
(
!
strict
&&
err
==
win32_2
),
"%s (%lx): got %ld, expected %ld or %ld"
,
"%s (%lx): got %ld, expected %ld or %ld
\n
"
,
message
,
win_nt
,
err
,
win32_1
,
win32_2
);
}
...
...
@@ -104,7 +104,7 @@ static void cmp_call4(NTSTATUS win_nt, ULONG win32_1, ULONG win32_2, const char*
err
=
statustodoserror
(
win_nt
);
ok
(
err
==
win32_1
||
(
!
strict
&&
(
err
==
win32_2
||
err
==
ERROR_MR_MID_NOT_FOUND
)),
"%s (%lx): got %ld, expected %ld or %ld"
,
"%s (%lx): got %ld, expected %ld or %ld
\n
"
,
message
,
win_nt
,
err
,
win32_1
,
win32_2
);
}
...
...
dlls/ntdll/tests/large_int.c
View file @
39081ddc
...
...
@@ -45,7 +45,7 @@ static NTSTATUS (WINAPI *pRtlUnicodeStringToAnsiString)(STRING *, const UNICODE_
static
void
InitFunctionPtrs
()
{
hntdll
=
LoadLibraryA
(
"ntdll.dll"
);
ok
(
hntdll
!=
0
,
"LoadLibrary failed"
);
ok
(
hntdll
!=
0
,
"LoadLibrary failed
\n
"
);
if
(
hntdll
)
{
pRtlExtendedMagicDivide
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlExtendedMagicDivide"
);
pRtlFreeAnsiString
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlFreeAnsiString"
);
...
...
@@ -120,7 +120,7 @@ static void test_RtlExtendedMagicDivide(void)
for
(
i
=
0
;
i
<
NB_MAGIC_DIVIDE
;
i
++
)
{
result
=
pRtlExtendedMagicDivide
(
magic_divide
[
i
].
a
,
magic_divide
[
i
].
b
,
magic_divide
[
i
].
shift
);
ok
(
result
==
magic_divide
[
i
].
result
,
"call failed: RtlExtendedMagicDivide(%lld, %llu, %d) has result %llx, expected %llx"
,
"call failed: RtlExtendedMagicDivide(%lld, %llu, %d) has result %llx, expected %llx
\n
"
,
magic_divide
[
i
].
a
,
magic_divide
[
i
].
b
,
magic_divide
[
i
].
shift
,
result
,
magic_divide
[
i
].
result
);
}
}
...
...
@@ -329,22 +329,22 @@ static void one_RtlInt64ToUnicodeString_test(int test_num, const largeint2str_t
}
/* if */
}
else
{
ok
(
result
==
largeint2str
->
result
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) has result %lx, expected: %lx"
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) has result %lx, expected: %lx
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
result
,
largeint2str
->
result
);
if
(
result
==
STATUS_SUCCESS
)
{
ok
(
unicode_string
.
Buffer
[
unicode_string
.
Length
/
sizeof
(
WCHAR
)]
==
'\0'
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) string
\"
%s
\"
is not NULL terminated"
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) string
\"
%s
\"
is not NULL terminated
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
ansi_str
.
Buffer
);
}
/* if */
}
/* if */
ok
(
memcmp
(
unicode_string
.
Buffer
,
expected_unicode_string
.
Buffer
,
LARGE_STRI_BUFFER_LENGTH
*
sizeof
(
WCHAR
))
==
0
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) assigns string
\"
%s
\"
, expected:
\"
%s
\"
"
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) assigns string
\"
%s
\"
, expected:
\"
%s
\"
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
ansi_str
.
Buffer
,
expected_ansi_str
.
Buffer
);
ok
(
unicode_string
.
Length
==
expected_unicode_string
.
Length
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) string has Length %d, expected: %d"
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) string has Length %d, expected: %d
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
unicode_string
.
Length
,
expected_unicode_string
.
Length
);
ok
(
unicode_string
.
MaximumLength
==
expected_unicode_string
.
MaximumLength
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) string has MaximumLength %d, expected: %d"
,
"(test %d): RtlInt64ToUnicodeString(%llu, %d, [out]) string has MaximumLength %d, expected: %d
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
unicode_string
.
MaximumLength
,
expected_unicode_string
.
MaximumLength
);
pRtlFreeAnsiString
(
&
expected_ansi_str
);
pRtlFreeAnsiString
(
&
ansi_str
);
...
...
@@ -376,10 +376,10 @@ static void one_RtlLargeIntegerToChar_test(int test_num, const largeint2str_t *l
result
=
pRtlLargeIntegerToChar
(
&
value
,
largeint2str
->
base
,
largeint2str
->
MaximumLength
,
dest_str
);
}
/* if */
ok
(
result
==
largeint2str
->
result
,
"(test %d): RtlLargeIntegerToChar(%llu, %d, %d, [out]) has result %lx, expected: %lx"
,
"(test %d): RtlLargeIntegerToChar(%llu, %d, %d, [out]) has result %lx, expected: %lx
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
largeint2str
->
MaximumLength
,
result
,
largeint2str
->
result
);
ok
(
memcmp
(
dest_str
,
largeint2str
->
Buffer
,
LARGE_STRI_BUFFER_LENGTH
)
==
0
,
"(test %d): RtlLargeIntegerToChar(%llu, %d, %d, [out]) assigns string
\"
%s
\"
, expected:
\"
%s
\"
"
,
"(test %d): RtlLargeIntegerToChar(%llu, %d, %d, [out]) assigns string
\"
%s
\"
, expected:
\"
%s
\"
\n
"
,
test_num
,
largeint2str
->
value
,
largeint2str
->
base
,
largeint2str
->
MaximumLength
,
dest_str
,
largeint2str
->
Buffer
);
}
...
...
@@ -397,22 +397,22 @@ static void test_RtlLargeIntegerToChar(void)
value
=
largeint2str
[
0
].
value
;
result
=
pRtlLargeIntegerToChar
(
&
value
,
20
,
largeint2str
[
0
].
MaximumLength
,
NULL
);
ok
(
result
==
STATUS_INVALID_PARAMETER
,
"(test a): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x"
,
"(test a): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x
\n
"
,
largeint2str
[
0
].
value
,
20
,
largeint2str
[
0
].
MaximumLength
,
result
,
STATUS_INVALID_PARAMETER
);
result
=
pRtlLargeIntegerToChar
(
&
value
,
20
,
0
,
NULL
);
ok
(
result
==
STATUS_INVALID_PARAMETER
,
"(test b): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x"
,
"(test b): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x
\n
"
,
largeint2str
[
0
].
value
,
20
,
largeint2str
[
0
].
MaximumLength
,
result
,
STATUS_INVALID_PARAMETER
);
result
=
pRtlLargeIntegerToChar
(
&
value
,
largeint2str
[
0
].
base
,
0
,
NULL
);
ok
(
result
==
STATUS_BUFFER_OVERFLOW
,
"(test c): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x"
,
"(test c): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x
\n
"
,
largeint2str
[
0
].
value
,
largeint2str
[
0
].
base
,
0
,
result
,
STATUS_BUFFER_OVERFLOW
);
result
=
pRtlLargeIntegerToChar
(
&
value
,
largeint2str
[
0
].
base
,
largeint2str
[
0
].
MaximumLength
,
NULL
);
ok
(
result
==
STATUS_ACCESS_VIOLATION
,
"(test d): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x"
,
"(test d): RtlLargeIntegerToChar(%llu, %d, %d, NULL) has result %lx, expected: %x
\n
"
,
largeint2str
[
0
].
value
,
largeint2str
[
0
].
base
,
largeint2str
[
0
].
MaximumLength
,
result
,
STATUS_ACCESS_VIOLATION
);
}
...
...
dlls/ntdll/tests/path.c
View file @
39081ddc
...
...
@@ -84,7 +84,7 @@ static void test_RtlDetermineDosPathNameType(void)
{
pRtlMultiByteToUnicodeN
(
buffer
,
sizeof
(
buffer
),
NULL
,
test
->
path
,
strlen
(
test
->
path
)
+
1
);
ret
=
pRtlDetermineDosPathNameType_U
(
buffer
);
ok
(
ret
==
test
->
ret
,
"Wrong result %d/%d for %s"
,
ret
,
test
->
ret
,
test
->
path
);
ok
(
ret
==
test
->
ret
,
"Wrong result %d/%d for %s
\n
"
,
ret
,
test
->
ret
,
test
->
path
);
}
}
...
...
@@ -148,7 +148,7 @@ static void test_RtlIsDosDeviceName(void)
pRtlMultiByteToUnicodeN
(
buffer
,
sizeof
(
buffer
),
NULL
,
test
->
path
,
strlen
(
test
->
path
)
+
1
);
ret
=
pRtlIsDosDeviceName_U
(
buffer
);
ok
(
ret
==
MAKELONG
(
test
->
len
,
test
->
pos
),
"Wrong result (%d,%d)/(%d,%d) for %s"
,
"Wrong result (%d,%d)/(%d,%d) for %s
\n
"
,
HIWORD
(
ret
),
LOWORD
(
ret
),
test
->
pos
,
test
->
len
,
test
->
path
);
}
}
...
...
@@ -209,18 +209,18 @@ static void test_RtlIsNameLegalDOS8Dot3(void)
oem_ret
.
Length
=
oem_ret
.
MaximumLength
=
sizeof
(
buff2
);
oem_ret
.
Buffer
=
buff2
;
ret
=
pRtlIsNameLegalDOS8Dot3
(
&
ustr
,
&
oem_ret
,
&
spaces
);
ok
(
ret
==
test
->
result
,
"Wrong result %d/%d for '%s'"
,
ret
,
test
->
result
,
test
->
path
);
ok
(
spaces
==
test
->
spaces
,
"Wrong spaces value %d/%d for '%s'"
,
spaces
,
test
->
spaces
,
test
->
path
);
ok
(
ret
==
test
->
result
,
"Wrong result %d/%d for '%s'
\n
"
,
ret
,
test
->
result
,
test
->
path
);
ok
(
spaces
==
test
->
spaces
,
"Wrong spaces value %d/%d for '%s'
\n
"
,
spaces
,
test
->
spaces
,
test
->
path
);
if
(
strlen
(
test
->
path
)
<=
12
)
{
char
str
[
13
];
int
i
;
strcpy
(
str
,
test
->
path
);
for
(
i
=
0
;
str
[
i
];
i
++
)
str
[
i
]
=
toupper
(
str
[
i
]);
ok
(
oem_ret
.
Length
==
strlen
(
test
->
path
),
"Wrong length %d/%d for '%s'"
,
ok
(
oem_ret
.
Length
==
strlen
(
test
->
path
),
"Wrong length %d/%d for '%s'
\n
"
,
oem_ret
.
Length
,
strlen
(
test
->
path
),
test
->
path
);
ok
(
!
memcmp
(
oem_ret
.
Buffer
,
str
,
oem_ret
.
Length
),
"Wrong string '%.*s'/'%s'"
,
oem_ret
.
Length
,
oem_ret
.
Buffer
,
str
);
"Wrong string '%.*s'/'%s'
\n
"
,
oem_ret
.
Length
,
oem_ret
.
Buffer
,
str
);
}
}
}
...
...
dlls/ntdll/tests/rtl.c
View file @
39081ddc
...
...
@@ -58,7 +58,7 @@ static char* dest = (char*)dest_aligned_block;
static
void
InitFunctionPtrs
(
void
)
{
hntdll
=
LoadLibraryA
(
"ntdll.dll"
);
ok
(
hntdll
!=
0
,
"LoadLibrary failed"
);
ok
(
hntdll
!=
0
,
"LoadLibrary failed
\n
"
);
if
(
hntdll
)
{
pRtlCompareMemory
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlCompareMemory"
);
pRtlCompareMemoryUlong
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlCompareMemoryUlong"
);
...
...
@@ -241,7 +241,7 @@ static void test_RtlUlonglongByteSwap(void)
result
=
pRtlUlonglongByteSwap
(
((
ULONGLONG
)
0x76543210
<<
32
)
|
0x87654321
);
ok
(
(((
ULONGLONG
)
0x21436587
<<
32
)
|
0x10325476
)
==
result
,
"RtlUlonglongByteSwap(0x7654321087654321) returns 0x%llx, expected 0x2143658710325476"
,
"RtlUlonglongByteSwap(0x7654321087654321) returns 0x%llx, expected 0x2143658710325476
\n
"
,
result
);
}
...
...
@@ -276,7 +276,7 @@ static void test_RtlUniform(void)
expected
=
0x7fffffc3
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 0)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 0)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
/*
* The algorithm is now:
...
...
@@ -297,7 +297,7 @@ static void test_RtlUniform(void)
expected
=
seed
*
0xffffffed
+
0x7fffffc3
+
1
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 1)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 1)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
/*
* For seed = 2 the const_2 is 0x7fffffc3:
...
...
@@ -306,7 +306,7 @@ static void test_RtlUniform(void)
expected
=
seed
*
0xffffffed
+
0x7fffffc3
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 2)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 2)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
/*
* More tests show that if seed is odd the result must be incremented by 1:
...
...
@@ -315,21 +315,21 @@ static void test_RtlUniform(void)
expected
=
seed
*
0xffffffed
+
0x7fffffc3
+
(
seed
&
1
);
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 2)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 2)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
seed
=
0x6bca1aa
;
expected
=
seed
*
0xffffffed
+
0x7fffffc3
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 0x6bca1aa)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 0x6bca1aa)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
seed
=
0x6bca1ab
;
expected
=
seed
*
0xffffffed
+
0x7fffffc3
+
1
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 0x6bca1ab)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 0x6bca1ab)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
/*
* When seed is 0x6bca1ac there is an exception:
...
...
@@ -338,7 +338,7 @@ static void test_RtlUniform(void)
expected
=
seed
*
0xffffffed
+
0x7fffffc3
+
2
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 0x6bca1ac)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 0x6bca1ac)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
/*
* Note that up to here const_3 is not used
...
...
@@ -350,14 +350,14 @@ static void test_RtlUniform(void)
expected
=
(
seed
*
0xffffffed
+
0x7fffffc3
)
&
MAXLONG
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 0x6bca1ad)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 0x6bca1ad)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
seed
=
0x6bca1ae
;
expected
=
(
seed
*
0xffffffed
+
0x7fffffc3
+
1
)
&
MAXLONG
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"RtlUniform(&seed (seed == 0x6bca1ae)) returns %lx, expected %lx"
,
"RtlUniform(&seed (seed == 0x6bca1ae)) returns %lx, expected %lx
\n
"
,
result
,
expected
);
/*
* There are several ranges where for odd or even seed the result must be
...
...
@@ -465,10 +465,10 @@ static void test_RtlUniform(void)
seed_bak
=
seed
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"test: %llu RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx"
,
"test: %llu RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx
\n
"
,
num
,
seed_bak
,
result
,
expected
);
ok
(
seed
==
expected
,
"test: %llu RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx"
,
"test: %llu RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx
\n
"
,
num
,
seed_bak
,
seed
,
expected
);
}
/* for */
/*
...
...
@@ -512,10 +512,10 @@ static void test_RtlUniform(void)
seed_bak
=
seed
;
result
=
pRtlUniform
(
&
seed
);
ok
(
result
==
expected
,
"test: %llu RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx"
,
"test: %llu RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx
\n
"
,
num
,
seed_bak
,
result
,
expected
);
ok
(
seed
==
expected
,
"test: %llu RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx"
,
"test: %llu RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx
\n
"
,
num
,
seed_bak
,
seed
,
expected
);
}
/* for */
/*
...
...
@@ -592,10 +592,10 @@ static void test_RtlRandom(void)
seed_expected
=
0x44b
;
result
=
pRtlRandom
(
&
seed
);
ok
(
result
==
result_expected
,
"pRtlRandom(&seed (seed == 0)) returns %lx, expected %lx"
,
"pRtlRandom(&seed (seed == 0)) returns %lx, expected %lx
\n
"
,
result
,
result_expected
);
ok
(
seed
==
seed_expected
,
"pRtlRandom(&seed (seed == 0)) sets seed to %lx, expected %lx"
,
"pRtlRandom(&seed (seed == 0)) sets seed to %lx, expected %lx
\n
"
,
seed
,
seed_expected
);
/*
* Seed is not equal to result as with RtlUniform. To see more we
...
...
@@ -606,10 +606,10 @@ static void test_RtlRandom(void)
seed_expected
=
0x44b
;
result
=
pRtlRandom
(
&
seed
);
ok
(
result
==
result_expected
,
"RtlRandom(&seed (seed == 0)) returns %lx, expected %lx"
,
"RtlRandom(&seed (seed == 0)) returns %lx, expected %lx
\n
"
,
result
,
result_expected
);
ok
(
seed
==
seed_expected
,
"RtlRandom(&seed (seed == 0)) sets seed to %lx, expected %lx"
,
"RtlRandom(&seed (seed == 0)) sets seed to %lx, expected %lx
\n
"
,
seed
,
seed_expected
);
/*
* Seed is set to the same value as before but the result is different.
...
...
@@ -620,10 +620,10 @@ static void test_RtlRandom(void)
seed_expected
=
0x44b
;
result
=
pRtlRandom
(
&
seed
);
ok
(
result
==
result_expected
,
"RtlRandom(&seed (seed == 0)) returns %lx, expected %lx"
,
"RtlRandom(&seed (seed == 0)) returns %lx, expected %lx
\n
"
,
result
,
result_expected
);
ok
(
seed
==
seed_expected
,
"RtlRandom(&seed (seed == 0)) sets seed to %lx, expected %lx"
,
"RtlRandom(&seed (seed == 0)) sets seed to %lx, expected %lx
\n
"
,
seed
,
seed_expected
);
/*
* Seed is aggain set to the same value as before. This time we also
...
...
@@ -668,10 +668,10 @@ static void test_RtlRandom(void)
seed_expected
=
0x5a1
;
result
=
pRtlRandom
(
&
seed
);
ok
(
result
==
result_expected
,
"RtlRandom(&seed (seed == 1)) returns %lx, expected %lx"
,
"RtlRandom(&seed (seed == 1)) returns %lx, expected %lx
\n
"
,
result
,
result_expected
);
ok
(
seed
==
seed_expected
,
"RtlRandom(&seed (seed == 1)) sets seed to %lx, expected %lx"
,
"RtlRandom(&seed (seed == 1)) sets seed to %lx, expected %lx
\n
"
,
seed
,
seed_expected
);
/*
* If there is just one saved_value the result now would be
...
...
@@ -729,10 +729,10 @@ static void test_RtlRandom(void)
}
/* if */
result
=
pRtlRandom
(
&
seed
);
ok
(
result
==
result_expected
,
"test: %llu RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx"
,
"test: %llu RtlUniform(&seed (seed == %lx)) returns %lx, expected %lx
\n
"
,
num
,
seed_bak
,
result
,
result_expected
);
ok
(
seed
==
seed_expected
,
"test: %llu RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx"
,
"test: %llu RtlUniform(&seed (seed == %lx)) sets seed to %lx, expected %lx
\n
"
,
num
,
seed_bak
,
seed
,
seed_expected
);
}
/* for */
}
...
...
@@ -768,7 +768,7 @@ static void test_RtlAreAllAccessesGranted(void)
result
=
pRtlAreAllAccessesGranted
(
all_accesses
[
test_num
].
GrantedAccess
,
all_accesses
[
test_num
].
DesiredAccess
);
ok
(
all_accesses
[
test_num
].
result
==
result
,
"(test %d): RtlAreAllAccessesGranted(%08lx, %08lx) returns %d, expected %d"
,
"(test %d): RtlAreAllAccessesGranted(%08lx, %08lx) returns %d, expected %d
\n
"
,
test_num
,
all_accesses
[
test_num
].
GrantedAccess
,
all_accesses
[
test_num
].
DesiredAccess
,
result
,
all_accesses
[
test_num
].
result
);
...
...
@@ -805,7 +805,7 @@ static void test_RtlAreAnyAccessesGranted(void)
result
=
pRtlAreAnyAccessesGranted
(
any_accesses
[
test_num
].
GrantedAccess
,
any_accesses
[
test_num
].
DesiredAccess
);
ok
(
any_accesses
[
test_num
].
result
==
result
,
"(test %d): RtlAreAnyAccessesGranted(%08lx, %08lx) returns %d, expected %d"
,
"(test %d): RtlAreAnyAccessesGranted(%08lx, %08lx) returns %d, expected %d
\n
"
,
test_num
,
any_accesses
[
test_num
].
GrantedAccess
,
any_accesses
[
test_num
].
DesiredAccess
,
result
,
any_accesses
[
test_num
].
result
);
...
...
dlls/ntdll/tests/rtlstr.c
View file @
39081ddc
This diff is collapsed.
Click to expand it.
dlls/ntdll/tests/string.c
View file @
39081ddc
This diff is collapsed.
Click to expand it.
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