Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(c) 2024 Huawei Technologies Co., Ltd 3 : : */ 4 : : 5 : : #include "test_soring_stress.h" 6 : : 7 : : static int 8 : 0 : run_test(const struct test *test) 9 : : { 10 : : int32_t rc; 11 : : uint32_t i, k; 12 : : 13 [ # # ]: 0 : for (i = 0, k = 0; i != test->nb_case; i++) { 14 : : 15 : : printf("TEST-CASE %s %s START\n", 16 : 0 : test->name, test->cases[i].name); 17 : : 18 : 0 : rc = test->cases[i].func(test->cases[i].wfunc); 19 : 0 : k += (rc == 0); 20 : : 21 [ # # ]: 0 : if (rc != 0) 22 : : printf("TEST-CASE %s %s FAILED\n", 23 : 0 : test->name, test->cases[i].name); 24 : : else 25 : : printf("TEST-CASE %s %s OK\n", 26 : 0 : test->name, test->cases[i].name); 27 : : } 28 : : 29 : 0 : return k; 30 : : } 31 : : 32 : : static int 33 : 0 : test_ring_stress(void) 34 : : { 35 : : uint32_t n, k; 36 : : 37 : : n = 0; 38 : : k = 0; 39 : : 40 : 0 : n += test_soring_mt_stress.nb_case; 41 : 0 : k += run_test(&test_soring_mt_stress); 42 : : 43 : 0 : printf("Number of tests:\t%u\nSuccess:\t%u\nFailed:\t%u\n", 44 : : n, k, n - k); 45 : 0 : return (k != n); 46 : : } 47 : : 48 : 252 : REGISTER_STRESS_TEST(soring_stress_autotest, test_ring_stress);