// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2020 Cyril Hrubis */ /* * Test macros. */ #include "tst_test.h" static int fail_fn(void) { errno = EINVAL; return -1; } static int pass_fn(void) { return 0; } static int inval_ret_fn(void) { return 42; } static void do_test(void) { TST_EXP_FAIL(fail_fn(), EINVAL); tst_res(TINFO, "TST_PASS = %i", TST_PASS); TST_EXP_FAIL(fail_fn(), ENOTTY); tst_res(TINFO, "TST_PASS = %i", TST_PASS); TST_EXP_FAIL(pass_fn(), ENOTTY); tst_res(TINFO, "TST_PASS = %i", TST_PASS); TST_EXP_FAIL(inval_ret_fn(), ENOTTY, "TEST DESCRIPTION"); tst_res(TINFO, "TST_PASS = %i", TST_PASS); } static struct tst_test test = { .test_all = do_test, };