Skip to content

Commit 981c4f5

Browse files
Working through more warnings
1 parent 51f570f commit 981c4f5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

test/server.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct Server2 {
1313
JsonRpc2Server server;
1414
TestServerConnector connector;
1515

16-
Server2() : connector(server) {}
16+
Server2() : server(), connector(server) {}
1717
};
1818

1919
TEST_CASE_METHOD(Server2, "v2_method_not_found", TEST_MODULE) {
@@ -61,9 +61,10 @@ TEST_CASE_METHOD(Server2, "v2_malformed_requests", TEST_MODULE) {
6161

6262
enum class category { ord, cc };
6363

64-
NLOHMANN_JSON_SERIALIZE_ENUM(category, {{category::ord, "order"}, {category::cc, "cc"}});
64+
NLOHMANN_JSON_SERIALIZE_ENUM(category, {{category::ord, "order"}, {category::cc, "cc"}})
6565

6666
struct product {
67+
product() : id(), price(), name(), cat() {}
6768
int id;
6869
double price;
6970
string name;
@@ -75,6 +76,8 @@ void from_json(const json &j, product &p);
7576

7677
class TestServer {
7778
public:
79+
TestServer() : param_proc(), param_a(), param_b(), catalog() {}
80+
7881
unsigned int add_function(unsigned int a, unsigned int b) {
7982
this->param_a = a;
8083
this->param_b = b;
@@ -95,8 +98,8 @@ class TestServer {
9598
};
9699

97100
void dirty_notification() { throw std::exception(); }
98-
int dirty_method(int a, int b) { throw std::exception(); }
99-
int dirty_method2(int a, int b) { throw - 7; }
101+
int dirty_method(int a, int b) { to_string(a+b); throw std::exception(); }
102+
int dirty_method2(int a, int b) { throw (a+b); }
100103

101104
string param_proc;
102105
int param_a;

test/testserverconnector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using namespace Catch::Matchers;
88

99
class TestServerConnector {
1010
public:
11-
explicit TestServerConnector(JsonRpcServer &handler) : handler(handler) {}
11+
explicit TestServerConnector(JsonRpcServer &handler) : handler(handler), raw_response() {}
1212

1313
void SendRawRequest(const string &request) { this->raw_response = handler.HandleRequest(request); }
1414
void SendRequest(const json &request) { SendRawRequest(request.dump()); }
@@ -60,4 +60,4 @@ class TestServerConnector {
6060
private:
6161
JsonRpcServer &handler;
6262
string raw_response;
63-
};
63+
};

0 commit comments

Comments
 (0)