Skip to content

Commit 298d4a7

Browse files
authored
Fix test warnings (#350)
1 parent b979c89 commit 298d4a7

12 files changed

Lines changed: 31 additions & 24 deletions

File tree

cpp-driver/tests/src/integration/tests/test_dbaas.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class DbaasTests : public Integration {
161161
return ccm_execute(args);
162162
}
163163

164-
bool start_node(int node) {
164+
bool start_node(unsigned int node) {
165165
Process::Args args;
166166
args.push_back(node_name(node));
167167
args.push_back("start");
@@ -171,10 +171,13 @@ class DbaasTests : public Integration {
171171
return ccm_execute(args);
172172
}
173173

174-
bool stop_node(int node) {
174+
bool stop_node(unsigned int node, bool is_kill = false) {
175175
Process::Args args;
176176
args.push_back(node_name(node));
177177
args.push_back("stop");
178+
if (is_kill) {
179+
args.push_back("--not-gently");
180+
}
178181
return ccm_execute(args);
179182
}
180183

@@ -411,7 +414,6 @@ CASSANDRA_INTEGRATION_TEST_F(DbaasTests, SchemaMetadata) {
411414
EXPECT_EQ("average", std::string(data, length));
412415
cass_aggregate_meta_full_name(aggregate_meta, &data, &length);
413416
EXPECT_EQ("average(int)", std::string(data, length));
414-
size_t count = cass_aggregate_meta_argument_count(aggregate_meta);
415417
ASSERT_EQ(1u, cass_aggregate_meta_argument_count(aggregate_meta));
416418
datatype = cass_aggregate_meta_argument_type(aggregate_meta, 0);
417419
EXPECT_EQ(CASS_VALUE_TYPE_INT, cass_data_type_type(datatype));

cpp-driver/tests/src/integration/tests/test_prepared.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ CASSANDRA_INTEGRATION_TEST_F(PreparedTests, PrepareFromExistingSimpleStatement)
146146
bound_statement.bind<Integer>(0, Integer(1));
147147

148148
Result result = session_.execute(bound_statement);
149-
ASSERT_EQ(result.row_count(), 1);
149+
ASSERT_EQ(result.row_count(), 1u);
150150
EXPECT_EQ(result.first_row().column_by_name<Integer>("value").value(), 99);
151151
}
152152

@@ -191,6 +191,6 @@ CASSANDRA_INTEGRATION_TEST_F(PreparedTests, PrepareFromExistingBoundStatement) {
191191
bound_statement2.bind<Integer>(0, Integer(1));
192192

193193
Result result = session_.execute(bound_statement2);
194-
ASSERT_EQ(result.row_count(), 1);
194+
ASSERT_EQ(result.row_count(), 1u);
195195
EXPECT_EQ(result.first_row().column_by_name<Integer>("value").value(), 99);
196196
}

cpp-driver/tests/src/unit/mockssandra.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ class ClientConnection {
143143
SSL* ssl_;
144144
BIO* incoming_bio_;
145145
BIO* outgoing_bio_;
146-
SslHandshakeState handshake_state_;
147146
};
148147

149148
class ClientConnectionFactory {

cpp-driver/tests/src/unit/tests/test_http_client.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ TEST_F(HttpClientUnitTest, CancelTimeout) {
126126
const HttpClient::Ptr& client(*it);
127127
if (!client->is_canceled()) {
128128
EXPECT_EQ(client->error_code(), HttpClient::HTTP_CLIENT_ERROR_TIMEOUT);
129-
EXPECT_EQ(client->status_code(), 404);
129+
EXPECT_EQ(client->status_code(), 404u);
130130
}
131131
}
132132
}
@@ -166,7 +166,7 @@ TEST_F(HttpClientUnitTest, InvalidPath) {
166166
uv_run(loop(), UV_RUN_DEFAULT);
167167
EXPECT_TRUE(is_failed);
168168
EXPECT_EQ(client->error_code(), HttpClient::HTTP_CLIENT_ERROR_HTTP_STATUS);
169-
EXPECT_EQ(client->status_code(), 404);
169+
EXPECT_EQ(client->status_code(), 404u);
170170

171171
stop_http_server();
172172
}
@@ -184,7 +184,7 @@ TEST_F(HttpClientUnitTest, Timeout) {
184184
uv_run(loop(), UV_RUN_DEFAULT);
185185
EXPECT_TRUE(is_failed);
186186
EXPECT_EQ(client->error_code(), HttpClient::HTTP_CLIENT_ERROR_TIMEOUT);
187-
EXPECT_EQ(client->status_code(), 404);
187+
EXPECT_EQ(client->status_code(), 404u);
188188

189189
stop_http_server();
190190
}

cpp-driver/tests/src/unit/tests/test_logging.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ TEST_F(LoggingUnitTest, ControlConnectionSeverityHigh) {
6565
add_logging_critera("Unable to establish a control connection to host 127.0.0.1", CASS_LOG_ERROR);
6666
Future::Ptr connect_future = connect_async();
6767
EXPECT_TRUE(connect_future->wait_for(WAIT_FOR_TIME));
68-
EXPECT_EQ(1u, logging_criteria_count());
68+
EXPECT_EQ(1, logging_criteria_count());
6969
}
7070

7171
/**
@@ -82,7 +82,7 @@ TEST_F(LoggingUnitTest, ControlConnectionSeverityReduced) {
8282
add_logging_critera("Lost control connection to host 127.0.0.1", CASS_LOG_WARN);
8383
Future::Ptr connect_future = connect_async();
8484
EXPECT_TRUE(connect_future->wait_for(WAIT_FOR_TIME));
85-
EXPECT_EQ(0u, logging_criteria_count());
85+
EXPECT_EQ(0, logging_criteria_count());
8686
cluster.stop_all();
8787
EXPECT_TRUE(wait_for_logger(1));
8888
}

cpp-driver/tests/src/unit/tests/test_pool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,5 +837,6 @@ TEST_F(PoolUnitTest, NoAvailableStreams) {
837837
initializer->initialize(loop(), hosts());
838838
uv_run(loop(), UV_RUN_DEFAULT);
839839

840-
EXPECT_EQ(status.count(RequestStatus::SUCCESS), CASS_MAX_STREAMS) << status.results();
840+
EXPECT_EQ(status.count(RequestStatus::SUCCESS), static_cast<size_t>(CASS_MAX_STREAMS))
841+
<< status.results();
841842
}

cpp-driver/tests/src/unit/tests/test_socket.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ class SocketUnitTest : public LoopTest {
214214
private:
215215
void verify_dns_check() {
216216
uv_getaddrinfo_t request;
217-
Address::SocketStorage storage;
218217
ASSERT_EQ(0, uv_getaddrinfo(loop(), &request, on_request, DNS_HOSTNAME, "8888", NULL));
219218
uv_run(loop(), UV_RUN_DEFAULT);
220219
}

cpp-driver/tests/src/unit/tests/test_supported_response.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ TEST_F(SupportedResponseUnitTest, Simple) {
5959
ASSERT_EQ(cluster.start_all(), 0);
6060

6161
StringMultimap supported_options;
62-
ASSERT_EQ(0, supported_options.size());
62+
ASSERT_EQ(0u, supported_options.size());
6363
Connector::Ptr connector(new Connector(Host::Ptr(new Host(Address("127.0.0.1", PORT))),
6464
PROTOCOL_VERSION,
6565
bind_callback(on_connect, &supported_options)));
@@ -112,7 +112,7 @@ TEST_F(SupportedResponseUnitTest, UppercaseKeysOnly) {
112112
ASSERT_EQ(cluster.start_all(), 0);
113113

114114
StringMultimap supported_options;
115-
ASSERT_EQ(0, supported_options.size());
115+
ASSERT_EQ(0u, supported_options.size());
116116
Connector::Ptr connector(new Connector(Host::Ptr(new Host(Address("127.0.0.1", PORT))),
117117
PROTOCOL_VERSION,
118118
bind_callback(on_connect, &supported_options)));

cpp-driver/tests/src/unit/unit.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ class Unit : public testing::Test {
242242
logging_criteria_;
243243
int logging_criteria_count_;
244244
uv_mutex_t mutex_;
245-
uint64_t start_time_;
246245
};
247246

248247
#endif // UNIT_TEST_HPP

tests/src/integration/dse_integration.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ void DseIntegration::connect() {
6969
connect(dse_cluster_);
7070
}
7171

72-
Cluster DseIntegration::default_cluster() {
73-
return dse::Cluster::build()
74-
.with_contact_points(contact_points_)
75-
.with_randomized_contact_points(is_randomized_contact_points_)
76-
.with_schema_metadata(is_schema_metadata_);
72+
Cluster DseIntegration::default_cluster(bool is_with_default_contact_points) {
73+
Cluster cluster = dse::Cluster::build()
74+
.with_randomized_contact_points(is_randomized_contact_points_)
75+
.with_schema_metadata(is_schema_metadata_);
76+
if (is_with_default_contact_points) {
77+
cluster.with_contact_points(contact_points_);
78+
}
79+
return cluster;
7780
}
7881

7982
void DseIntegration::create_graph(const std::string& graph_name,

0 commit comments

Comments
 (0)