@@ -122,17 +122,21 @@ test_stream_writev_full (void)
122122 r = _mongoc_stream_writev_full (error_stream , iov , 2 , 100 , & error );
123123
124124 BSON_ASSERT (!r );
125- BSON_ASSERT (error .domain == MONGOC_ERROR_STREAM );
126- BSON_ASSERT (error .code == MONGOC_ERROR_STREAM_SOCKET );
127- BSON_ASSERT (strncmp (error .message , error_message , strlen (
128- error_message )) == 0 );
125+ ASSERT_CMPINT (error .domain , = = , MONGOC_ERROR_STREAM );
126+ ASSERT_CMPINT (error .code , = = , MONGOC_ERROR_STREAM_SOCKET );
127+ if ((error .message ) != strstr ((error .message ), (error_message ))) {
128+ fprintf (stderr ,
129+ "FAIL\n\nAssert Failure: \"%s\" does not start with \"%s\"\n" ,
130+ error .message , error_message );
131+ abort ();
132+ }
129133
130134 errno = 0 ;
131135 r = _mongoc_stream_writev_full (short_stream , iov , 2 , 100 , & error );
132136 BSON_ASSERT (!r );
133- BSON_ASSERT (error .domain == MONGOC_ERROR_STREAM );
134- BSON_ASSERT (error .code == MONGOC_ERROR_STREAM_SOCKET );
135- BSON_ASSERT ( strcmp ( error .message , short_message ) == 0 );
137+ ASSERT_CMPINT (error .domain , = = , MONGOC_ERROR_STREAM );
138+ ASSERT_CMPINT (error .code , = = , MONGOC_ERROR_STREAM_SOCKET );
139+ ASSERT_CMPSTR ( error .message , short_message );
136140
137141 errno = 0 ;
138142 r = _mongoc_stream_writev_full (success_stream , iov , 2 , 100 , & error );
0 commit comments