@@ -1988,10 +1988,6 @@ test_mongoc_uri_duplicates (void)
1988
1988
ASSERT_LOG_DUPE (MONGOC_URI_LOCALTHRESHOLDMS );
1989
1989
BSON_ASSERT (mongoc_uri_get_option_as_int32 (uri , MONGOC_URI_LOCALTHRESHOLDMS , 0 ) == 2 );
1990
1990
1991
- RECREATE_URI (MONGOC_URI_MAXIDLETIMEMS "=1&" MONGOC_URI_MAXIDLETIMEMS "=2" );
1992
- ASSERT_LOG_DUPE (MONGOC_URI_MAXIDLETIMEMS );
1993
- BSON_ASSERT (mongoc_uri_get_option_as_int32 (uri , MONGOC_URI_MAXIDLETIMEMS , 0 ) == 2 );
1994
-
1995
1991
RECREATE_URI (MONGOC_URI_MAXPOOLSIZE "=1&" MONGOC_URI_MAXPOOLSIZE "=2" );
1996
1992
ASSERT_LOG_DUPE (MONGOC_URI_MAXPOOLSIZE );
1997
1993
BSON_ASSERT (mongoc_uri_get_option_as_int32 (uri , MONGOC_URI_MAXPOOLSIZE , 0 ) == 2 );
@@ -2093,10 +2089,6 @@ test_mongoc_uri_duplicates (void)
2093
2089
wc = mongoc_uri_get_write_concern (uri );
2094
2090
BSON_ASSERT (mongoc_write_concern_get_w (wc ) == MONGOC_WRITE_CONCERN_W_MAJORITY );
2095
2091
2096
- RECREATE_URI (MONGOC_URI_WAITQUEUEMULTIPLE "=1&" MONGOC_URI_WAITQUEUEMULTIPLE "=2" );
2097
- ASSERT_LOG_DUPE (MONGOC_URI_WAITQUEUEMULTIPLE );
2098
- BSON_ASSERT (mongoc_uri_get_option_as_int32 (uri , MONGOC_URI_WAITQUEUEMULTIPLE , 0 ) == 2 );
2099
-
2100
2092
RECREATE_URI (MONGOC_URI_WAITQUEUETIMEOUTMS "=1&" MONGOC_URI_WAITQUEUETIMEOUTMS "=2" );
2101
2093
ASSERT_LOG_DUPE (MONGOC_URI_WAITQUEUETIMEOUTMS );
2102
2094
BSON_ASSERT (mongoc_uri_get_option_as_int32 (uri , MONGOC_URI_WAITQUEUETIMEOUTMS , 0 ) == 2 );
@@ -2301,6 +2293,38 @@ test_parses_long_ipv6 (void)
2301
2293
}
2302
2294
}
2303
2295
2296
+ void
2297
+ test_uri_depr (void )
2298
+ {
2299
+ // Test behavior of deprecated URI options.
2300
+ // Regression test for CDRIVER-3769 Deprecate unimplemented URI options
2301
+
2302
+ // Test an unsupported option warns.
2303
+ {
2304
+ capture_logs (true);
2305
+ mongoc_uri_t * uri = mongoc_uri_new ("mongodb://host/?foo=bar" );
2306
+ ASSERT_CAPTURED_LOG ("uri" , MONGOC_LOG_LEVEL_WARNING , "Unsupported" );
2307
+ capture_logs (false);
2308
+ mongoc_uri_destroy (uri );
2309
+ }
2310
+ // Test that waitQueueMultiple warns.
2311
+ {
2312
+ capture_logs (true);
2313
+ mongoc_uri_t * uri = mongoc_uri_new ("mongodb://host/?waitQueueMultiple=123" );
2314
+ ASSERT_CAPTURED_LOG ("uri" , MONGOC_LOG_LEVEL_WARNING , "Unsupported" );
2315
+ capture_logs (false);
2316
+ mongoc_uri_destroy (uri );
2317
+ }
2318
+ // Test that maxIdleTimeMS warns.
2319
+ {
2320
+ capture_logs (true);
2321
+ mongoc_uri_t * uri = mongoc_uri_new ("mongodb://host/?maxIdleTimeMS=123" );
2322
+ ASSERT_CAPTURED_LOG ("uri" , MONGOC_LOG_LEVEL_WARNING , "Unsupported" );
2323
+ capture_logs (false);
2324
+ mongoc_uri_destroy (uri );
2325
+ }
2326
+ }
2327
+
2304
2328
void
2305
2329
test_uri_install (TestSuite * suite )
2306
2330
{
@@ -2328,4 +2352,5 @@ test_uri_install (TestSuite *suite)
2328
2352
TestSuite_Add (suite , "/Uri/one_tls_option_enables_tls" , test_one_tls_option_enables_tls );
2329
2353
TestSuite_Add (suite , "/Uri/options_casing" , test_casing_options );
2330
2354
TestSuite_Add (suite , "/Uri/parses_long_ipv6" , test_parses_long_ipv6 );
2355
+ TestSuite_Add (suite , "/Uri/depr" , test_uri_depr );
2331
2356
}
0 commit comments