Skip to content

Commit 5c9d4b2

Browse files
committed
CDRIVER-697 no bson_return calls in tests
1 parent 3c9b883 commit 5c9d4b2

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/ha-test.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ ha_sharded_cluster_add_replica_set (ha_sharded_cluster_t *cluster,
841841
{
842842
int i;
843843

844-
bson_return_if_fail(cluster);
845-
bson_return_if_fail(replica_set);
844+
BSON_ASSERT (cluster);
845+
BSON_ASSERT (replica_set);
846846

847847
for (i = 0; i < 12; i++) {
848848
if (!cluster->replicas[i]) {
@@ -860,7 +860,7 @@ ha_sharded_cluster_add_config (ha_sharded_cluster_t *cluster,
860860
ha_node_t *node;
861861
char dbpath[PATH_MAX];
862862

863-
bson_return_val_if_fail(cluster, NULL);
863+
BSON_ASSERT (cluster);
864864

865865
bson_snprintf(dbpath, sizeof dbpath, "%s/%s", cluster->name, name);
866866
dbpath[sizeof dbpath - 1] = '\0';
@@ -889,7 +889,7 @@ ha_sharded_cluster_add_router (ha_sharded_cluster_t *cluster,
889889
ha_node_t *node;
890890
char dbpath[PATH_MAX];
891891

892-
bson_return_val_if_fail(cluster, NULL);
892+
BSON_ASSERT (cluster);
893893

894894
bson_snprintf(dbpath, sizeof dbpath, "%s/%s", cluster->name, name);
895895
dbpath[sizeof dbpath - 1] = '\0';
@@ -972,7 +972,7 @@ ha_sharded_cluster_start (ha_sharded_cluster_t *cluster)
972972
ha_node_t *iter;
973973
int i;
974974

975-
bson_return_if_fail(cluster);
975+
BSON_ASSERT (cluster);
976976

977977
if (!stat(cluster->name, &st)) {
978978
if (S_ISDIR(st.st_mode)) {
@@ -1024,7 +1024,7 @@ ha_sharded_cluster_wait_for_healthy (ha_sharded_cluster_t *cluster)
10241024
{
10251025
int i;
10261026

1027-
bson_return_if_fail(cluster);
1027+
BSON_ASSERT (cluster);
10281028

10291029
for (i = 0; i < 12; i++) {
10301030
if (cluster->replicas[i]) {
@@ -1040,7 +1040,7 @@ ha_sharded_cluster_shutdown (ha_sharded_cluster_t *cluster)
10401040
ha_node_t *iter;
10411041
int i;
10421042

1043-
bson_return_if_fail(cluster);
1043+
BSON_ASSERT (cluster);
10441044

10451045
for (i = 0; i < 12; i++) {
10461046
if (cluster->replicas[i]) {

tests/test-mongoc-server-selection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test_rtt_calculation_cb (bson_t *test)
5858
mongoc_server_description_t *description;
5959
bson_iter_t iter;
6060

61-
bson_return_if_fail (test);
61+
BSON_ASSERT (test);
6262

6363
description = (mongoc_server_description_t *)bson_malloc0(sizeof *description);
6464
mongoc_server_description_init(description, "localhost:27017", 1);
@@ -115,7 +115,7 @@ test_server_selection_logic_cb (bson_t *test)
115115

116116
mongoc_array_t selected_servers;
117117

118-
bson_return_if_fail (test);
118+
BSON_ASSERT (test);
119119

120120
/* pull out topology description field */
121121
assert(bson_iter_init_find(&iter, test, "topology_description"));

0 commit comments

Comments
 (0)