Browse Source

More realiable tests

Paul-Louis Ageneau 5 years ago
parent
commit
738cbe78a0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      test/capi.cpp
  2. 1 1
      test/connectivity.cpp

+ 1 - 1
test/capi.cpp

@@ -168,7 +168,7 @@ int test_capi_main() {
 	rtcSetMessageCallback(peer1->dc, messageCallback);
 
 	attempts = 10;
-	while (!peer2->connected && attempts--)
+	while (!peer2->connected && !peer1->connected && attempts--)
 		sleep(1);
 
 	if (peer1->state != RTC_CONNECTED || peer2->state != RTC_CONNECTED) {

+ 1 - 1
test/connectivity.cpp

@@ -115,7 +115,7 @@ void test_connectivity() {
 	});
 
 	int attempts = 10;
-	while ((!dc2 || !dc2->isOpen()) && attempts--)
+	while ((!dc2 || !dc2->isOpen() || !dc1->isOpen()) && attempts--)
 		this_thread::sleep_for(1s);
 
 	if (pc1->state() != PeerConnection::State::Connected &&