Skip to content

Commit 58ba05c

Browse files
author
Michael Penick
committed
Merge branch 'master' into unified_driver
2 parents 7658307 + 298d4a7 commit 58ba05c

11 files changed

Lines changed: 27 additions & 22 deletions

File tree

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ void DseIntegration::connect() {
4141
connect(dse_cluster_);
4242
}
4343

44-
Cluster DseIntegration::default_cluster() {
45-
return dse::Cluster::build()
46-
.with_contact_points(contact_points_)
47-
.with_randomized_contact_points(is_randomized_contact_points_)
48-
.with_schema_metadata(is_schema_metadata_);
44+
Cluster DseIntegration::default_cluster(bool is_with_default_contact_points) {
45+
Cluster cluster = dse::Cluster::build()
46+
.with_randomized_contact_points(is_randomized_contact_points_)
47+
.with_schema_metadata(is_schema_metadata_);
48+
if (is_with_default_contact_points) {
49+
cluster.with_contact_points(contact_points_);
50+
}
51+
return cluster;
4952
}

cpp-driver/tests/src/integration/dse_integration.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ class DseIntegration : public Integration {
8080
/**
8181
* Get the default DSE cluster configuration
8282
*
83+
* @param is_with_default_contact_points True if default contact points
84+
should be added to the cluster
8385
* @return DSE Cluster object (default)
8486
*/
85-
virtual Cluster default_cluster();
87+
virtual Cluster default_cluster(bool is_with_default_contact_points = true);
8688

8789
protected:
8890
/**

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
@@ -68,7 +68,7 @@ TEST_F(SupportedResponseUnitTest, Simple) {
6868
ASSERT_EQ(cluster.start_all(), 0);
6969

7070
StringMultimap supported_options;
71-
ASSERT_EQ(0, supported_options.size());
71+
ASSERT_EQ(0u, supported_options.size());
7272
Connector::Ptr connector(new Connector(Host::Ptr(new Host(Address("127.0.0.1", PORT))),
7373
PROTOCOL_VERSION,
7474
bind_callback(on_connect, &supported_options)));
@@ -121,7 +121,7 @@ TEST_F(SupportedResponseUnitTest, UppercaseKeysOnly) {
121121
ASSERT_EQ(cluster.start_all(), 0);
122122

123123
StringMultimap supported_options;
124-
ASSERT_EQ(0, supported_options.size());
124+
ASSERT_EQ(0u, supported_options.size());
125125
Connector::Ptr connector(new Connector(Host::Ptr(new Host(Address("127.0.0.1", PORT))),
126126
PROTOCOL_VERSION,
127127
bind_callback(on_connect, &supported_options)));

0 commit comments

Comments
 (0)