Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Nov 16, 2024
1 parent a4159b1 commit 6b2a8ab
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
14 changes: 9 additions & 5 deletions NetSSL_OpenSSL/testsuite/src/WebSocketTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace
n = ws.receiveFrame(buffer.begin(), static_cast<int>(_bufSize), flags);
if (n == 0)
break;
Poco::Thread::current()->sleep(handleDelay.totalMilliseconds());
Poco::Thread::current()->sleep(static_cast<long>(handleDelay.totalMilliseconds()));
ws.sendFrame(buffer.begin(), n, flags);
}
while ((flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE);
Expand Down Expand Up @@ -148,7 +148,7 @@ void WebSocketTest::testWebSocketTimeout()

failmsg("Data exchange shall time out.");
}
catch (const Poco::TimeoutException& te)
catch (const Poco::TimeoutException&)
{
assertTrue(sendStart.elapsed() < Poco::Timespan(4, 0).totalMicroseconds());
}
Expand Down Expand Up @@ -222,7 +222,8 @@ void WebSocketTest::testWebSocket()
assertTrue (n == 2);
assertTrue ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE);

server.stopAll(true);
ws.close();
server.stop();
}


Expand Down Expand Up @@ -258,7 +259,9 @@ void WebSocketTest::testWebSocketLarge()
assertTrue (n == payload.size());
assertTrue (payload.compare(0, payload.size(), buffer, 0, n) == 0);

server.stopAll(true);
ws.shutdown();
ws.close();
server.stop();
}


Expand Down Expand Up @@ -325,7 +328,8 @@ void WebSocketTest::testWebSocketNB()
assertTrue (n == 2);
assertTrue ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE);

server.stopAll(true);
ws.close();
server.stop();
}


Expand Down
7 changes: 3 additions & 4 deletions NetSSL_Win/testsuite/src/HTTPSClientSessionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ void HTTPSClientSessionTest::testInterop()
std::set<std::string> domainNames;
cert.extractNames(commonName, domainNames);

assertTrue (commonName == "secure.appinf.com" || commonName == "*.appinf.com");
assertTrue (domainNames.find("appinf.com") != domainNames.end()
|| domainNames.find("*.appinf.com") != domainNames.end());
assertTrue (commonName.find(".appinf.com") != std::string::npos);
assertTrue (domainNames.find("secure.appinf.com") != domainNames.end()
|| domainNames.find("download.appinf.com") != domainNames.end());
}


Expand All @@ -326,7 +326,6 @@ void HTTPSClientSessionTest::testProxy()
StreamCopier::copyStream(rs, ostr);
std::string str(ostr.str());
assertTrue (str == "This is a test file for NetSSL.\n");
assertTrue (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
}


Expand Down
4 changes: 4 additions & 0 deletions NetSSL_Win/testsuite/src/WebSocketTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ void WebSocketTest::testWebSocketLarge()

assertTrue (n == payload.size());
assertTrue (payload.compare(0, payload.size(), buffer, 0, n) == 0);

ws.shutdown();
ws.close();
server.stop();
}


Expand Down

0 comments on commit 6b2a8ab

Please sign in to comment.