From efb245278d1f3d51ad242a658fe39e79d2a06cd6 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Mon, 31 Aug 2020 13:56:45 -0700 Subject: [PATCH] unittest / switch from using the REQUIRE macro, which halts (and usually crash) the test to the CHECK macro in IXWebSocketChatTest.cpp --- test/IXWebSocketChatTest.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/IXWebSocketChatTest.cpp b/test/IXWebSocketChatTest.cpp index 80f3acde..16c81319 100644 --- a/test/IXWebSocketChatTest.cpp +++ b/test/IXWebSocketChatTest.cpp @@ -285,27 +285,27 @@ TEST_CASE("Websocket_chat", "[websocket_chat]") int attempts = 0; while (chatA.getReceivedMessagesCount() != 3 || chatB.getReceivedMessagesCount() != 3) { - REQUIRE(attempts++ < 10); + CHECK(attempts++ < 10); ix::msleep(1000); } chatA.stop(); chatB.stop(); - REQUIRE(chatA.getReceivedMessagesCount() == 3); - REQUIRE(chatB.getReceivedMessagesCount() == 3); + CHECK(chatA.getReceivedMessagesCount() == 3); + CHECK(chatB.getReceivedMessagesCount() == 3); - REQUIRE(chatB.getReceivedMessages()[0] == "from A1"); - REQUIRE(chatB.getReceivedMessages()[1] == "from A2"); - REQUIRE(chatB.getReceivedMessages()[2] == "from A3"); + CHECK(chatB.getReceivedMessages()[0] == "from A1"); + CHECK(chatB.getReceivedMessages()[1] == "from A2"); + CHECK(chatB.getReceivedMessages()[2] == "from A3"); - REQUIRE(chatA.getReceivedMessages()[0] == "from B1"); - REQUIRE(chatA.getReceivedMessages()[1] == "from B2"); - REQUIRE(chatA.getReceivedMessages()[2].size() == bigMessage.size()); + CHECK(chatA.getReceivedMessages()[0] == "from B1"); + CHECK(chatA.getReceivedMessages()[1] == "from B2"); + CHECK(chatA.getReceivedMessages()[2].size() == bigMessage.size()); // Give us 1000ms for the server to notice that clients went away ix::msleep(1000); - REQUIRE(server.getClients().size() == 0); + CHECK(server.getClients().size() == 0); ix::reportWebSocketTraffic(); }