mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 08:41:11 +01:00
chore: fix tests
This commit is contained in:
parent
a4159b1723
commit
6b2a8abd96
@ -57,7 +57,7 @@ namespace
|
|||||||
n = ws.receiveFrame(buffer.begin(), static_cast<int>(_bufSize), flags);
|
n = ws.receiveFrame(buffer.begin(), static_cast<int>(_bufSize), flags);
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
break;
|
break;
|
||||||
Poco::Thread::current()->sleep(handleDelay.totalMilliseconds());
|
Poco::Thread::current()->sleep(static_cast<long>(handleDelay.totalMilliseconds()));
|
||||||
ws.sendFrame(buffer.begin(), n, flags);
|
ws.sendFrame(buffer.begin(), n, flags);
|
||||||
}
|
}
|
||||||
while ((flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE);
|
while ((flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE);
|
||||||
@ -148,7 +148,7 @@ void WebSocketTest::testWebSocketTimeout()
|
|||||||
|
|
||||||
failmsg("Data exchange shall time out.");
|
failmsg("Data exchange shall time out.");
|
||||||
}
|
}
|
||||||
catch (const Poco::TimeoutException& te)
|
catch (const Poco::TimeoutException&)
|
||||||
{
|
{
|
||||||
assertTrue(sendStart.elapsed() < Poco::Timespan(4, 0).totalMicroseconds());
|
assertTrue(sendStart.elapsed() < Poco::Timespan(4, 0).totalMicroseconds());
|
||||||
}
|
}
|
||||||
@ -222,7 +222,8 @@ void WebSocketTest::testWebSocket()
|
|||||||
assertTrue (n == 2);
|
assertTrue (n == 2);
|
||||||
assertTrue ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE);
|
assertTrue ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE);
|
||||||
|
|
||||||
server.stopAll(true);
|
ws.close();
|
||||||
|
server.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -258,7 +259,9 @@ void WebSocketTest::testWebSocketLarge()
|
|||||||
assertTrue (n == payload.size());
|
assertTrue (n == payload.size());
|
||||||
assertTrue (payload.compare(0, payload.size(), buffer, 0, n) == 0);
|
assertTrue (payload.compare(0, payload.size(), buffer, 0, n) == 0);
|
||||||
|
|
||||||
server.stopAll(true);
|
ws.shutdown();
|
||||||
|
ws.close();
|
||||||
|
server.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -325,7 +328,8 @@ void WebSocketTest::testWebSocketNB()
|
|||||||
assertTrue (n == 2);
|
assertTrue (n == 2);
|
||||||
assertTrue ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE);
|
assertTrue ((flags & WebSocket::FRAME_OP_BITMASK) == WebSocket::FRAME_OP_CLOSE);
|
||||||
|
|
||||||
server.stopAll(true);
|
ws.close();
|
||||||
|
server.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -303,9 +303,9 @@ void HTTPSClientSessionTest::testInterop()
|
|||||||
std::set<std::string> domainNames;
|
std::set<std::string> domainNames;
|
||||||
cert.extractNames(commonName, domainNames);
|
cert.extractNames(commonName, domainNames);
|
||||||
|
|
||||||
assertTrue (commonName == "secure.appinf.com" || commonName == "*.appinf.com");
|
assertTrue (commonName.find(".appinf.com") != std::string::npos);
|
||||||
assertTrue (domainNames.find("appinf.com") != domainNames.end()
|
assertTrue (domainNames.find("secure.appinf.com") != domainNames.end()
|
||||||
|| domainNames.find("*.appinf.com") != domainNames.end());
|
|| domainNames.find("download.appinf.com") != domainNames.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -326,7 +326,6 @@ void HTTPSClientSessionTest::testProxy()
|
|||||||
StreamCopier::copyStream(rs, ostr);
|
StreamCopier::copyStream(rs, ostr);
|
||||||
std::string str(ostr.str());
|
std::string str(ostr.str());
|
||||||
assertTrue (str == "This is a test file for NetSSL.\n");
|
assertTrue (str == "This is a test file for NetSSL.\n");
|
||||||
assertTrue (cert.commonName() == "secure.appinf.com" || cert.commonName() == "*.appinf.com");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -207,6 +207,10 @@ void WebSocketTest::testWebSocketLarge()
|
|||||||
|
|
||||||
assertTrue (n == payload.size());
|
assertTrue (n == payload.size());
|
||||||
assertTrue (payload.compare(0, payload.size(), buffer, 0, n) == 0);
|
assertTrue (payload.compare(0, payload.size(), buffer, 0, n) == 0);
|
||||||
|
|
||||||
|
ws.shutdown();
|
||||||
|
ws.close();
|
||||||
|
server.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user