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
f229c911
Commit
f229c911
authored
Jan 23, 2004
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trailing '\n's to ok() calls.
parent
399901e0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
78 deletions
+78
-78
atom.c
dlls/kernel/tests/atom.c
+32
-32
codepage.c
dlls/kernel/tests/codepage.c
+2
-2
sock.c
dlls/winsock/tests/sock.c
+34
-34
info.c
dlls/winspool/tests/info.c
+10
-10
No files found.
dlls/kernel/tests/atom.c
View file @
f229c911
...
...
@@ -39,13 +39,13 @@ static void test_add_atom(void)
SetLastError
(
0xdeadbeef
);
atom
=
GlobalAddAtomA
(
"foobar"
);
ok
(
atom
>=
0xc000
,
"bad atom id %x"
,
atom
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomA set last error"
);
ok
(
atom
>=
0xc000
,
"bad atom id %x
\n
"
,
atom
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomA set last error
\n
"
);
/* Verify that it can be found (or not) appropriately */
ok
(
GlobalFindAtomA
(
"foobar"
)
==
atom
,
"could not find atom foobar"
);
ok
(
GlobalFindAtomA
(
"FOOBAR"
)
==
atom
,
"could not find atom FOOBAR"
);
ok
(
!
GlobalFindAtomA
(
"_foobar"
),
"found _foobar"
);
ok
(
GlobalFindAtomA
(
"foobar"
)
==
atom
,
"could not find atom foobar
\n
"
);
ok
(
GlobalFindAtomA
(
"FOOBAR"
)
==
atom
,
"could not find atom FOOBAR
\n
"
);
ok
(
!
GlobalFindAtomA
(
"_foobar"
),
"found _foobar
\n
"
);
/* Add the same atom, specifying string as unicode; should
* find the first one, not add a new one */
...
...
@@ -58,16 +58,16 @@ static void test_add_atom(void)
if
(
unicode_OS
)
{
ok
(
w_atom
==
atom
,
"Unicode atom does not match ASCII"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomW set last error"
);
ok
(
w_atom
==
atom
,
"Unicode atom does not match ASCII
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GlobalAddAtomW set last error
\n
"
);
}
/* Verify that it can be found (or not) appropriately via unicode name */
if
(
unicode_OS
)
{
ok
(
GlobalFindAtomW
(
foobarW
)
==
atom
,
"could not find atom foobar"
);
ok
(
GlobalFindAtomW
(
FOOBARW
)
==
atom
,
"could not find atom FOOBAR"
);
ok
(
!
GlobalFindAtomW
(
_foobarW
),
"found _foobar"
);
ok
(
GlobalFindAtomW
(
foobarW
)
==
atom
,
"could not find atom foobar
\n
"
);
ok
(
GlobalFindAtomW
(
FOOBARW
)
==
atom
,
"could not find atom FOOBAR
\n
"
);
ok
(
!
GlobalFindAtomW
(
_foobarW
),
"found _foobar
\n
"
);
}
/* Test integer atoms
...
...
@@ -75,11 +75,11 @@ static void test_add_atom(void)
* (0xc000 .. 0xffff) should be invalid */
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomA
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0"
);
ok
(
GlobalAddAtomA
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0
\n
"
);
if
(
unicode_OS
)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomW
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0"
);
ok
(
GlobalAddAtomW
(
0
)
==
0
&&
GetLastError
()
==
0xdeadbeef
,
"succeeded to add atom 0
\n
"
);
}
SetLastError
(
0xdeadbeef
);
...
...
@@ -87,20 +87,20 @@ static void test_add_atom(void)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomA
((
LPCSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %x"
,
i
);
"failed to add atom %x
\n
"
,
i
);
if
(
unicode_OS
)
{
SetLastError
(
0xdeadbeef
);
ok
(
GlobalAddAtomW
((
LPCWSTR
)
i
)
==
i
&&
GetLastError
()
==
0xdeadbeef
,
"failed to add atom %x"
,
i
);
"failed to add atom %x
\n
"
,
i
);
}
}
for
(
i
=
0xc000
;
i
<=
0xffff
;
i
++
)
{
ok
(
!
GlobalAddAtomA
((
LPCSTR
)
i
),
"succeeded adding %x"
,
i
);
ok
(
!
GlobalAddAtomA
((
LPCSTR
)
i
),
"succeeded adding %x
\n
"
,
i
);
if
(
unicode_OS
)
ok
(
!
GlobalAddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %x"
,
i
);
ok
(
!
GlobalAddAtomW
((
LPCWSTR
)
i
),
"succeeded adding %x
\n
"
,
i
);
}
}
...
...
@@ -117,8 +117,8 @@ static void test_get_atom_name(void)
/* Get the name of the atom we added above */
memset
(
buf
,
'.'
,
sizeof
(
buf
)
);
len
=
GlobalGetAtomNameA
(
atom
,
buf
,
10
);
ok
(
len
==
strlen
(
"foobar"
),
"bad length %d"
,
len
);
ok
(
!
memcmp
(
buf
,
"foobar
\0
..."
,
10
),
"bad buffer contents"
);
ok
(
len
==
strlen
(
"foobar"
),
"bad length %d
\n
"
,
len
);
ok
(
!
memcmp
(
buf
,
"foobar
\0
..."
,
10
),
"bad buffer contents
\n
"
);
/* Repeat, unicode-style */
if
(
unicode_OS
)
...
...
@@ -126,23 +126,23 @@ static void test_get_atom_name(void)
for
(
i
=
0
;
i
<
10
;
i
++
)
bufW
[
i
]
=
'.'
;
SetLastError
(
0xdeadbeef
);
len
=
GlobalGetAtomNameW
(
atom
,
bufW
,
10
);
ok
(
len
&&
GetLastError
()
==
0xdeadbeef
,
"GlobalGetAtomNameW failed"
);
ok
(
len
==
lstrlenW
(
foobarW
),
"bad length %d"
,
len
);
ok
(
!
memcmp
(
bufW
,
resultW
,
10
*
sizeof
(
WCHAR
)
),
"bad buffer contents"
);
ok
(
len
&&
GetLastError
()
==
0xdeadbeef
,
"GlobalGetAtomNameW failed
\n
"
);
ok
(
len
==
lstrlenW
(
foobarW
),
"bad length %d
\n
"
,
len
);
ok
(
!
memcmp
(
bufW
,
resultW
,
10
*
sizeof
(
WCHAR
)
),
"bad buffer contents
\n
"
);
}
/* Check error code returns */
memset
(
buf
,
'.'
,
10
);
ok
(
!
GlobalGetAtomNameA
(
atom
,
buf
,
0
),
"succeeded"
);
ok
(
!
memcmp
(
buf
,
".........."
,
10
),
"should not touch buffer"
);
ok
(
!
GlobalGetAtomNameA
(
atom
,
buf
,
0
),
"succeeded
\n
"
);
ok
(
!
memcmp
(
buf
,
".........."
,
10
),
"should not touch buffer
\n
"
);
if
(
unicode_OS
)
{
static
const
WCHAR
sampleW
[
10
]
=
{
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
,
'.'
};
for
(
i
=
0
;
i
<
10
;
i
++
)
bufW
[
i
]
=
'.'
;
ok
(
!
GlobalGetAtomNameW
(
atom
,
bufW
,
0
),
"succeeded"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
10
*
sizeof
(
WCHAR
)
),
"should not touch buffer"
);
ok
(
!
GlobalGetAtomNameW
(
atom
,
bufW
,
0
),
"succeeded
\n
"
);
ok
(
!
memcmp
(
bufW
,
sampleW
,
10
*
sizeof
(
WCHAR
)
),
"should not touch buffer
\n
"
);
}
/* Test integer atoms */
...
...
@@ -153,13 +153,13 @@ static void test_get_atom_name(void)
if
(
i
)
{
char
res
[
20
];
ok
(
(
len
>
1
)
&&
(
len
<
7
),
"bad length %d"
,
len
);
ok
(
(
len
>
1
)
&&
(
len
<
7
),
"bad length %d
\n
"
,
len
);
sprintf
(
res
,
"#%d"
,
i
);
memset
(
res
+
strlen
(
res
)
+
1
,
'a'
,
10
);
ok
(
!
memcmp
(
res
,
buf
,
10
),
"bad buffer contents %s"
,
buf
);
ok
(
!
memcmp
(
res
,
buf
,
10
),
"bad buffer contents %s
\n
"
,
buf
);
}
else
ok
(
!
len
,
"bad length %d"
,
len
);
ok
(
!
len
,
"bad length %d
\n
"
,
len
);
}
}
...
...
@@ -171,15 +171,15 @@ static void test_error_handling(void)
memset
(
buffer
,
'a'
,
256
);
buffer
[
256
]
=
0
;
ok
(
!
GlobalAddAtomA
(
buffer
),
"add succeeded"
);
ok
(
!
GlobalFindAtomA
(
buffer
),
"find succeeded"
);
ok
(
!
GlobalAddAtomA
(
buffer
),
"add succeeded
\n
"
);
ok
(
!
GlobalFindAtomA
(
buffer
),
"find succeeded
\n
"
);
if
(
unicode_OS
)
{
for
(
i
=
0
;
i
<
256
;
i
++
)
bufferW
[
i
]
=
'b'
;
bufferW
[
256
]
=
0
;
ok
(
!
GlobalAddAtomW
(
bufferW
),
"add succeeded"
);
ok
(
!
GlobalFindAtomW
(
bufferW
),
"find succeeded"
);
ok
(
!
GlobalAddAtomW
(
bufferW
),
"add succeeded
\n
"
);
ok
(
!
GlobalFindAtomW
(
bufferW
),
"find succeeded
\n
"
);
}
}
...
...
dlls/kernel/tests/codepage.c
View file @
f229c911
...
...
@@ -47,13 +47,13 @@ static void test_negative_source_length(void)
memset
(
buf
,
'x'
,
sizeof
(
buf
));
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
foobarW
,
-
2002
,
buf
,
10
,
NULL
,
NULL
);
ok
(
len
==
7
&&
!
lstrcmpA
(
buf
,
"foobar"
)
&&
GetLastError
()
==
0xdeadbeef
,
"WideCharToMultiByte(-2002): len=%d error=%ld"
,
len
,
GetLastError
());
"WideCharToMultiByte(-2002): len=%d error=%ld
\n
"
,
len
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
memset
(
bufW
,
'x'
,
sizeof
(
bufW
));
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
"foobar"
,
-
2002
,
bufW
,
10
);
ok
(
len
==
7
&&
!
mylstrcmpW
(
bufW
,
foobarW
)
&&
GetLastError
()
==
0xdeadbeef
,
"MultiByteToWideChar(-2002): len=%d error=%ld"
,
len
,
GetLastError
());
"MultiByteToWideChar(-2002): len=%d error=%ld
\n
"
,
len
,
GetLastError
());
}
START_TEST
(
codepage
)
...
...
dlls/winsock/tests/sock.c
View file @
f229c911
This diff is collapsed.
Click to expand it.
dlls/winspool/tests/info.c
View file @
f229c911
...
...
@@ -35,21 +35,21 @@ static void test_printer_directory(ivoid)
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
cbBuf
*
2
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
,
&
pcbNeeded
);
ok
(
res
,
"expected result != 0, got %d"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld"
,
ok
(
res
,
"expected result != 0, got %d
\n
"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld
\n
"
,
pcbNeeded
,
cbBuf
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
*
2
,
&
pcbNeeded
);
ok
(
res
,
"expected result != 0, got %d"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld"
,
ok
(
res
,
"expected result != 0, got %d
\n
"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld
\n
"
,
pcbNeeded
,
cbBuf
);
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
-
1
,
&
pcbNeeded
);
ok
(
!
res
,
"expected result == 0, got %d"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld"
,
ok
(
!
res
,
"expected result == 0, got %d
\n
"
,
res
);
ok
(
cbBuf
==
pcbNeeded
,
"pcbNeeded set to %ld instead of %ld
\n
"
,
pcbNeeded
,
cbBuf
);
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"last error set to %ld instead of ERROR_INSUFFICIENT_BUFFER"
,
"last error set to %ld instead of ERROR_INSUFFICIENT_BUFFER
\n
"
,
GetLastError
());
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
NULL
,
cbBuf
,
&
pcbNeeded
);
...
...
@@ -58,13 +58,13 @@ static void test_printer_directory(ivoid)
"expected either result == 0 and "
"last error == ERROR_INVALID_USER_BUFFER "
"or result != 0 and last error == ERROR_INVALID_PARAMETER "
"got result %d and last error == %ld"
,
res
,
GetLastError
());
"got result %d and last error == %ld
\n
"
,
res
,
GetLastError
());
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
buffer
,
cbBuf
,
NULL
);
ok
(
(
!
res
&&
RPC_X_NULL_REF_POINTER
==
GetLastError
())
||
res
,
"expected either result == 0 and "
"last error == RPC_X_NULL_REF_POINTER or result != 0 "
"got result %d and last error == %ld"
,
res
,
GetLastError
());
"got result %d and last error == %ld
\n
"
,
res
,
GetLastError
());
res
=
GetPrinterDriverDirectoryA
(
NULL
,
NULL
,
1
,
NULL
,
cbBuf
,
NULL
);
ok
(
(
!
res
&&
RPC_X_NULL_REF_POINTER
==
GetLastError
())
||
...
...
@@ -72,7 +72,7 @@ static void test_printer_directory(ivoid)
"expected either result == 0 and "
"last error == RPC_X_NULL_REF_POINTER "
"or result != 0 and last error == ERROR_INVALID_PARAMETER "
"got result %d and last error == %ld"
,
res
,
GetLastError
());
"got result %d and last error == %ld
\n
"
,
res
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
...
...
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