Make tests more platform agnostic (#4650)

Use QTemporaryDir to create the test directory
Add option to use httpbin over local docker
Increase delay for opening a connection

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2023-05-26 14:54:23 +02:00
committed by GitHub
parent 2264c44f10
commit 1bc423d9c4
8 changed files with 56 additions and 24 deletions
+4 -4
View File
@@ -48,7 +48,7 @@ TEST(TwitchPubSubClient, ServerRespondsToPings)
pubSub->listenToTopic("test");
std::this_thread::sleep_for(50ms);
std::this_thread::sleep_for(150ms);
ASSERT_EQ(pubSub->diag.connectionsOpened, 1);
ASSERT_EQ(pubSub->diag.connectionsClosed, 0);
@@ -211,7 +211,7 @@ TEST(TwitchPubSubClient, ExceedTopicLimitSingleStep)
pubSub->listenToTopic("test");
}
std::this_thread::sleep_for(50ms);
std::this_thread::sleep_for(150ms);
ASSERT_EQ(pubSub->diag.connectionsOpened, 2);
ASSERT_EQ(pubSub->diag.connectionsClosed, 0);
@@ -242,7 +242,7 @@ TEST(TwitchPubSubClient, ReceivedWhisper)
pubSub->listenToTopic("whispers.123456");
std::this_thread::sleep_for(50ms);
std::this_thread::sleep_for(150ms);
ASSERT_EQ(pubSub->diag.connectionsOpened, 1);
ASSERT_EQ(pubSub->diag.connectionsClosed, 0);
@@ -324,7 +324,7 @@ TEST(TwitchPubSubClient, MissingToken)
pubSub->listenToTopic("chat_moderator_actions.123456.123456");
std::this_thread::sleep_for(50ms);
std::this_thread::sleep_for(150ms);
ASSERT_EQ(pubSub->diag.connectionsOpened, 1);
ASSERT_EQ(pubSub->diag.connectionsClosed, 0);