1 /*
2  * Copyright (c) 2006-2019, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2019-01-16     MurphyZhao   the first version
9  */
10 
11 #include <rtthread.h>
12 #include "utest.h"
13 
test_assert_pass(void)14 static void test_assert_pass(void)
15 {
16     uassert_true(1);
17     uassert_false(0);
18 
19     uassert_null(RT_NULL);
20     uassert_not_null(!RT_NULL);
21 
22     uassert_int_equal(1, 1);
23     uassert_int_not_equal(1, 2);
24 
25     uassert_str_equal("Hello RT-Thread!", "Hello RT-Thread!");
26     uassert_str_not_equal("Hello RT-Thread!", "Hello");
27 
28     uassert_in_range(2048, 1024, 4096);
29     uassert_not_in_range(0, 1024, 4096);
30 }
31 
utest_tc_init(void)32 static rt_err_t utest_tc_init(void)
33 {
34     return RT_EOK;
35 }
36 
utest_tc_cleanup(void)37 static rt_err_t utest_tc_cleanup(void)
38 {
39     return RT_EOK;
40 }
41 
testcase(void)42 static void testcase(void)
43 {
44     UTEST_UNIT_RUN(test_assert_pass);
45 }
46 UTEST_TC_EXPORT(testcase, "testcases.utest.pass_tc", utest_tc_init, utest_tc_cleanup, 10);
47