https://git.reactos.org/?p=reactos.git;a=commitdiff;h=478bfb484aae097e8102b…
commit 478bfb484aae097e8102b2655795a9a3d2a6b19e
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Wed Jan 31 10:23:44 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Wed Jan 31 10:38:13 2018 +0100
[KMTESTS:TCPIP] Fix ok() messages.
---
modules/rostests/kmtests/tcpip/TcpIp_user.c | 23 ++++++++++++++---------
modules/rostests/kmtests/tcpip/connect.c | 4 ++--
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/modules/rostests/kmtests/tcpip/TcpIp_user.c
b/modules/rostests/kmtests/tcpip/TcpIp_user.c
index 7d9fb562a9..80f33b090f 100644
--- a/modules/rostests/kmtests/tcpip/TcpIp_user.c
+++ b/modules/rostests/kmtests/tcpip/TcpIp_user.c
@@ -30,9 +30,12 @@ UnloadTcpIpTestDriver(void)
START_TEST(TcpIpTdi)
{
+ DWORD Error;
+
LoadTcpIpTestDriver();
- ok(KmtSendToDriver(IOCTL_TEST_TDI) == ERROR_SUCCESS, "\n");
+ Error = KmtSendToDriver(IOCTL_TEST_TDI);
+ ok_eq_ulong(Error, ERROR_SUCCESS);
UnloadTcpIpTestDriver();
}
@@ -54,10 +57,10 @@ AcceptProc(
/* Initialize winsock */
WinsockVersion = MAKEWORD(2, 0);
Error = WSAStartup(WinsockVersion, &WsaData);
- ok(Error == 0, "");
+ ok_eq_int(Error, 0);
ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- ok(ListenSocket != INVALID_SOCKET, "socket failed");
+ ok(ListenSocket != INVALID_SOCKET, "socket failed\n");
ZeroMemory(&ListenAddress, sizeof(ListenAddress));
ListenAddress.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
@@ -65,16 +68,16 @@ AcceptProc(
ListenAddress.sin_family = AF_INET;
Error = bind(ListenSocket, (struct sockaddr*)&ListenAddress,
sizeof(ListenAddress));
- ok(Error == 0, "");
+ ok_eq_int(Error, 0);
Error = listen(ListenSocket, 1);
- ok(Error == 0, "");
+ ok_eq_int(Error, 0);
SetEvent(ReadyToConnectEvent);
AcceptAddressLength = sizeof(AcceptAddress);
AcceptSocket = accept(ListenSocket, (struct sockaddr*)&AcceptAddress,
&AcceptAddressLength);
- ok(AcceptSocket != INVALID_SOCKET, "\n");
+ ok(AcceptSocket != INVALID_SOCKET, "accept failed\n");
ok_eq_long(AcceptAddressLength, sizeof(AcceptAddress));
ok_eq_hex(AcceptAddress.sin_addr.S_un.S_addr, inet_addr("127.0.0.1"));
ok_eq_hex(AcceptAddress.sin_port, htons(TEST_CONNECT_CLIENT_PORT));
@@ -86,18 +89,20 @@ START_TEST(TcpIpConnect)
{
HANDLE AcceptThread;
HANDLE ReadyToConnectEvent;
+ DWORD Error;
ReadyToConnectEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
- ok(ReadyToConnectEvent != NULL, "\n");
+ ok(ReadyToConnectEvent != NULL, "CreateEvent failed\n");
AcceptThread = CreateThread(NULL, 0, AcceptProc, (PVOID)ReadyToConnectEvent, 0,
NULL);
- ok(AcceptThread != NULL, "");
+ ok(AcceptThread != NULL, "CreateThread failed\n");
WaitForSingleObject(ReadyToConnectEvent, INFINITE);
LoadTcpIpTestDriver();
- ok(KmtSendToDriver(IOCTL_TEST_CONNECT) == ERROR_SUCCESS, "\n");
+ Error = KmtSendToDriver(IOCTL_TEST_CONNECT);
+ ok_eq_ulong(Error, ERROR_SUCCESS);
WaitForSingleObject(AcceptThread, INFINITE);
diff --git a/modules/rostests/kmtests/tcpip/connect.c
b/modules/rostests/kmtests/tcpip/connect.c
index 366756f1cb..d548a636c2 100644
--- a/modules/rostests/kmtests/tcpip/connect.c
+++ b/modules/rostests/kmtests/tcpip/connect.c
@@ -68,7 +68,7 @@ TestTcpConnect(void)
FileInfo = ExAllocatePoolWithTag(NonPagedPool,
FileInfoSize,
TAG_TEST);
- ok(FileInfo != NULL, "");
+ ok(FileInfo != NULL, "FileInfo is NULL!\n");
RtlZeroMemory(FileInfo, FileInfoSize);
FileInfo->EaNameLength = TDI_TRANSPORT_ADDRESS_LENGTH;
@@ -111,7 +111,7 @@ TestTcpConnect(void)
FileInfo = ExAllocatePoolWithTag(NonPagedPool,
FileInfoSize,
TAG_TEST);
- ok(FileInfo != NULL, "");
+ ok(FileInfo != NULL, "FileInfo is NULL!\n");
RtlZeroMemory(FileInfo, FileInfoSize);
FileInfo->EaNameLength = TDI_CONNECTION_CONTEXT_LENGTH;