X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Fparam-validation%2Ftest_param_validation.c;h=fa1401046e23b2d9acf32734edcdd0010e0d652c;hb=900eef7317d3e8b350a93fb8782639845c62c2bd;hp=200b55140e5cf35e67d1e795c502d8d5cbde4fce;hpb=d0d4e0ed487ea23aaf0d023513c0a4d86901b79b;p=babeltrace.git diff --git a/tests/param-validation/test_param_validation.c b/tests/param-validation/test_param_validation.c index 200b5514..fa140104 100644 --- a/tests/param-validation/test_param_validation.c +++ b/tests/param-validation/test_param_validation.c @@ -1,18 +1,7 @@ /* - * Copyright (c) EfficiOS Inc. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * Copyright (C) EfficiOS Inc. */ #include "tap/tap.h" @@ -51,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 { @@ -340,7 +328,7 @@ void test_custom_validation_func_invalid(void) int main(void) { - plan_tests(34); + plan_tests(41); test_map_valid();