update test
This commit is contained in:
parent
b935bc526a
commit
f9ec89cf7a
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* IXWebSocketServerTest.cpp
|
* IXWebSocketMessageQTest.cpp
|
||||||
* Author: Korchynskyi Dmytro
|
* Author: Korchynskyi Dmytro
|
||||||
* Copyright (c) 2019 Machine Zone. All rights reserved.
|
* Copyright (c) 2019 Machine Zone. All rights reserved.
|
||||||
*/
|
*/
|
||||||
@ -135,6 +135,7 @@ namespace
|
|||||||
if (receivedCount >= 3)
|
if (receivedCount >= 3)
|
||||||
{
|
{
|
||||||
testDone = true;
|
testDone = true;
|
||||||
|
succeeded = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -162,12 +163,15 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSucceeded() const { return succeeded; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebSocket ws;
|
WebSocket ws;
|
||||||
WebSocketMessageQueue msgQ;
|
WebSocketMessageQueue msgQ;
|
||||||
bool testDone = false;
|
bool testDone = false;
|
||||||
uint32_t receivedCount = 0;
|
uint32_t receivedCount = 0;
|
||||||
std::thread::id mainThreadId;
|
std::thread::id mainThreadId;
|
||||||
|
bool succeeded = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +185,7 @@ TEST_CASE("Websocket_message_queue", "[websocket_message_q]")
|
|||||||
|
|
||||||
MsgQTestClient testClient;
|
MsgQTestClient testClient;
|
||||||
testClient.run("ws://127.0.0.1:" + std::to_string(port));
|
testClient.run("ws://127.0.0.1:" + std::to_string(port));
|
||||||
|
REQUIRE(testClient.isSucceeded());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user