Skip to content

Commit bfcd1a4

Browse files
committed
Revert "CDRIVER-2282 test NULL error and mongoc_topology_compatible"
This reverts commit 7e8c82d I forgot that on the 1.8 branch, a maxWireVersion 1 server is still considered compatible.
1 parent e7e6c00 commit bfcd1a4

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

tests/test-mongoc-topology.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,39 +1332,6 @@ test_ismaster_retry_pooled_timeout_fail (void)
13321332
}
13331333

13341334

1335-
/* ensure there's no invalid access if a null bson_error_t pointer is passed
1336-
* to mongoc_topology_compatible () */
1337-
static void
1338-
test_compatible_null_error_pointer (void)
1339-
{
1340-
mock_server_t *server;
1341-
mongoc_client_t *client;
1342-
mongoc_topology_description_t *td;
1343-
bson_error_t error;
1344-
1345-
server = mock_server_with_autoismaster (1); /* incompatible */
1346-
mock_server_run (server);
1347-
client = mongoc_client_new_from_uri (mock_server_get_uri (server));
1348-
td = &client->topology->description;
1349-
1350-
/* trigger connection, fails due to incompatibility */
1351-
ASSERT (!mongoc_client_command_simple (
1352-
client, "admin", tmp_bson ("{'ismaster': 1}"), NULL, NULL, &error));
1353-
1354-
ASSERT_ERROR_CONTAINS (error,
1355-
MONGOC_ERROR_PROTOCOL,
1356-
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
1357-
"");
1358-
1359-
/* null error pointer is ok */
1360-
ASSERT (!mongoc_topology_compatible (
1361-
td, NULL /* read prefs */, NULL /* error */));
1362-
1363-
mongoc_client_destroy (client);
1364-
mock_server_destroy (server);
1365-
}
1366-
1367-
13681335
void
13691336
test_topology_install (TestSuite *suite)
13701337
{
@@ -1471,7 +1438,4 @@ test_topology_install (TestSuite *suite)
14711438
TestSuite_AddMockServerTest (suite,
14721439
"/Topology/ismaster_retry/pooled/timeout/fail",
14731440
test_ismaster_retry_pooled_timeout_fail);
1474-
TestSuite_AddMockServerTest (suite,
1475-
"/Topology/compatible_null_error_pointer",
1476-
test_compatible_null_error_pointer);
14771441
}

0 commit comments

Comments
 (0)