66
77#include "test-libmongoc.h"
88
9+ #define ASSERT_SUPPRESS (x ) \
10+ do { \
11+ suppress_one_message (); \
12+ ASSERT (x); \
13+ } while (0)
14+
915static void
1016test_mongoc_uri_new (void )
1117{
@@ -19,6 +25,22 @@ test_mongoc_uri_new (void)
1925
2026 /* bad uris */
2127 ASSERT (!mongoc_uri_new ("mongodb://" ));
28+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://\x80" ));
29+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://localhost/\x80" ));
30+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://localhost:\x80/" ));
31+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://localhost/?ipv6=\x80" ));
32+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://localhost/?foo=\x80" ));
33+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://localhost/?\x80=bar" ));
34+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://\x80:pass@localhost" ));
35+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://user:\x80@localhost" ));
36+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://user%40DOMAIN.COM:password@localhost/?"
37+ "authMechanism=\x80" ));
38+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://user%40DOMAIN.COM:password@localhost/?"
39+ "authMechanism=GSSAPI"
40+ "&authMechanismProperties=SERVICE_NAME:\x80" ));
41+ ASSERT_SUPPRESS (!mongoc_uri_new ("mongodb://user%40DOMAIN.COM:password@localhost/?"
42+ "authMechanism=GSSAPI"
43+ "&authMechanismProperties=\x80:mongodb" ));
2244 ASSERT (!mongoc_uri_new ("mongodb://::" ));
2345 ASSERT (!mongoc_uri_new ("mongodb://localhost::27017" ));
2446 ASSERT (!mongoc_uri_new ("mongodb://localhost,localhost::" ));
@@ -347,6 +369,8 @@ test_mongoc_uri_new (void)
347369 mongoc_uri_destroy (uri );
348370}
349371
372+ #undef ASSERT_SUPPRESS
373+
350374static void
351375test_mongoc_host_list_from_string (void )
352376{
0 commit comments