X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=tests%2Fparam-validation%2Ftest_param_validation.c;h=fa1401046e23b2d9acf32734edcdd0010e0d652c;hp=62cd858bd395dc372f11b13f4ca66e565cac6389;hb=900eef7317d3e8b350a93fb8782639845c62c2bd;hpb=25a74feac6681e831f748723353a46ce48155dda diff --git a/tests/param-validation/test_param_validation.c b/tests/param-validation/test_param_validation.c index 62cd858b..fa140104 100644 --- a/tests/param-validation/test_param_validation.c +++ b/tests/param-validation/test_param_validation.c @@ -40,20 +40,19 @@ enum bt_param_validation_status run_test( status = bt_param_validation_validate(params, entries, &validate_error); if (expected_error) { - const char *fmt; - /* We expect a failure. */ ok(status == BT_PARAM_VALIDATION_STATUS_VALIDATION_ERROR, "%s: validation fails", test_name); ok(validate_error, "%s: error string is not NULL", test_name); - fmt = "%s: error string contains expected string"; +#define BT_FMT "%s: error string contains expected string" if (validate_error && strstr(validate_error, expected_error)) { - pass(fmt, test_name); + pass(BT_FMT, test_name); } else { - fail(fmt, test_name); + fail(BT_FMT, test_name); diag("could not find `%s` in `%s`", expected_error, validate_error); } +#undef BT_FMT g_free(validate_error); } else {