Skip to content

Commit b91eea4

Browse files
authored
Use httpbin.org instead of example.com for /http tests (#1161)
* CDRIVER-4537 Ensure stdout and stderr are flushed prior to abort * CDRIVER-4538 Use httpbin.org instead of example.com for /http tests
1 parent 0429b0a commit b91eea4

File tree

3 files changed

+401
-371
lines changed

3 files changed

+401
-371
lines changed

src/libmongoc/tests/TestSuite.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ test_msg (const char *format, ...)
6666
va_start (ap, format);
6767
vprintf (format, ap);
6868
printf ("\n");
69-
fflush (stdout);
7069
va_end (ap);
70+
fflush (stdout);
7171
}
7272

7373

@@ -76,11 +76,12 @@ _test_error (const char *format, ...)
7676
{
7777
va_list ap;
7878

79+
fflush (stdout);
7980
va_start (ap, format);
8081
vfprintf (stderr, format, ap);
8182
fprintf (stderr, "\n");
82-
fflush (stderr);
8383
va_end (ap);
84+
fflush (stderr);
8485
abort ();
8586
}
8687

@@ -222,7 +223,6 @@ TestSuite_Init (TestSuite *suite, const char *name, int argc, char **argv)
222223
} else {
223224
test_error ("Unrecognized option: MONGOC_TEST_SERVER_LOG=%s",
224225
mock_server_log);
225-
abort ();
226226
}
227227

228228
bson_free (mock_server_log);
@@ -231,7 +231,6 @@ TestSuite_Init (TestSuite *suite, const char *name, int argc, char **argv)
231231
if (suite->silent) {
232232
if (suite->outfile) {
233233
test_error ("Cannot combine -F with --silent");
234-
abort ();
235234
}
236235

237236
suite->flags &= ~(TEST_DEBUGOUTPUT);
@@ -298,11 +297,11 @@ _TestSuite_AddCheck (Test *test, CheckFunc check, const char *name)
298297
{
299298
test->checks[test->num_checks] = check;
300299
if (++test->num_checks > MAX_TEST_CHECK_FUNCS) {
301-
fprintf (stderr,
302-
"Too many check funcs for %s, increase MAX_TEST_CHECK_FUNCS "
303-
"to more than %d\n",
304-
name,
305-
MAX_TEST_CHECK_FUNCS);
300+
MONGOC_STDERR_PRINTF (
301+
"Too many check funcs for %s, increase MAX_TEST_CHECK_FUNCS "
302+
"to more than %d\n",
303+
name,
304+
MAX_TEST_CHECK_FUNCS);
306305
abort ();
307306
}
308307
}

0 commit comments

Comments
 (0)