fix unittest warnings + remove trailing spaces

This commit is contained in:
Benjamin Sergeant 2019-09-12 11:43:52 -07:00
parent a55d4cdb76
commit 57086e28d8
25 changed files with 87 additions and 106 deletions

View File

@ -59,6 +59,3 @@ app@ca2340eb9106:~$ ws --help
ws is a websocket tool ws is a websocket tool
... ...
``` ```

View File

@ -47,7 +47,7 @@ trail:
sh third_party/remote_trailing_whitespaces.sh sh third_party/remote_trailing_whitespaces.sh
format: format:
find test ixwebsocket ws -name '*.cpp' -o -name '*.h' -exec clang-format -i {} \; clang-format -i `find test ixwebsocket ws -name '*.cpp' -o -name '*.h'`
# That target is used to start a node server, but isn't required as we have # That target is used to start a node server, but isn't required as we have
# a builtin C++ server started in the unittest now # a builtin C++ server started in the unittest now

View File

@ -23,7 +23,6 @@ namespace ix
int getAnyFreePort() int getAnyFreePort()
{ {
int defaultPort = 8090;
int sockfd; int sockfd;
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{ {
@ -89,5 +88,3 @@ namespace ix
return -1; return -1;
} }
} // namespace ix } // namespace ix

View File

@ -28,7 +28,6 @@ namespace
void stop(); void stop();
void stop(uint16_t code, const std::string& reason); void stop(uint16_t code, const std::string& reason);
bool isReady() const; bool isReady() const;
void sendMessage(const std::string& text);
uint16_t getCloseCode(); uint16_t getCloseCode();
const std::string& getCloseReason(); const std::string& getCloseReason();
@ -171,11 +170,6 @@ namespace
_webSocket.start(); _webSocket.start();
} }
void WebSocketClient::sendMessage(const std::string& text)
{
_webSocket.send(text);
}
bool startServer(ix::WebSocketServer& server, bool startServer(ix::WebSocketServer& server,
uint16_t& receivedCloseCode, uint16_t& receivedCloseCode,
std::string& receivedCloseReason, std::string& receivedCloseReason,

View File

@ -112,6 +112,8 @@ TEST_CASE("Websocket_server", "[websocket_server]")
auto lineResult = socket->readLine(isCancellationRequested); auto lineResult = socket->readLine(isCancellationRequested);
auto lineValid = lineResult.first; auto lineValid = lineResult.first;
REQUIRE(lineValid);
auto line = lineResult.second; auto line = lineResult.second;
int status = -1; int status = -1;
@ -149,6 +151,8 @@ TEST_CASE("Websocket_server", "[websocket_server]")
auto lineResult = socket->readLine(isCancellationRequested); auto lineResult = socket->readLine(isCancellationRequested);
auto lineValid = lineResult.first; auto lineValid = lineResult.first;
REQUIRE(lineValid);
auto line = lineResult.second; auto line = lineResult.second;
int status = -1; int status = -1;
@ -190,6 +194,8 @@ TEST_CASE("Websocket_server", "[websocket_server]")
auto lineResult = socket->readLine(isCancellationRequested); auto lineResult = socket->readLine(isCancellationRequested);
auto lineValid = lineResult.first; auto lineValid = lineResult.first;
REQUIRE(lineValid);
auto line = lineResult.second; auto line = lineResult.second;
int status = -1; int status = -1;

View File

@ -4945,8 +4945,3 @@ std::ostream& operator<<(std::ostream& sout, Value const& root) {
// ////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////
// End of content of file: src/lib_json/json_writer.cpp // End of content of file: src/lib_json/json_writer.cpp
// ////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////

View File

@ -41,4 +41,3 @@
[ ] Question [ ] Question
[ ] Enhancement [ ] Enhancement
[ ] Bug [ ] Bug

View File

@ -120,4 +120,3 @@ In addition to providing options for testing client-side features, the `ssl_clie
* [`x509/crl_app.c`](x509/crl_app.c): loads and dumps a certificate revocation list (CRL). * [`x509/crl_app.c`](x509/crl_app.c): loads and dumps a certificate revocation list (CRL).
* [`x509/req_app.c`](x509/req_app.c): loads and dumps a certificate signing request (CSR). * [`x509/req_app.c`](x509/req_app.c): loads and dumps a certificate signing request (CSR).

View File

@ -21,12 +21,7 @@
// //
// //
// 2 Run the test server (using docker) // 2 Run the test server (using docker)
// docker run -it --rm \ // docker run -it --rm -v "${PWD}/config:/config" -v "${PWD}/reports:/reports" -p 9001:9001 --name fuzzingserver crossbario/autobahn-testsuite
// -v "${PWD}/config:/config" \
// -v "${PWD}/reports:/reports" \
// -p 9001:9001 \
// --name fuzzingserver \
// crossbario/autobahn-testsuite
// //
// 3. Run this command // 3. Run this command
// ws autobahn -q --url ws://localhost:9001 // ws autobahn -q --url ws://localhost:9001
@ -315,4 +310,3 @@ namespace ix
return generateReport(url) ? 0 : 1; return generateReport(url) ? 0 : 1;
} }
} }