pass_tc.c 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #include <rtthread.h>
  11. #include "utest.h"
  12. static void test_assert_pass(void)
  13. {
  14. uassert_true(1);
  15. uassert_false(0);
  16. uassert_null(RT_NULL);
  17. uassert_not_null(!RT_NULL);
  18. uassert_int_equal(1, 1);
  19. uassert_int_not_equal(1, 2);
  20. uassert_str_equal("Hello RT-Thread!", "Hello RT-Thread!");
  21. uassert_str_not_equal("Hello RT-Thread!", "Hello");
  22. uassert_in_range(2048, 1024, 4096);
  23. uassert_not_in_range(0, 1024, 4096);
  24. }
  25. static rt_err_t utest_tc_init(void)
  26. {
  27. return RT_EOK;
  28. }
  29. static rt_err_t utest_tc_cleanup(void)
  30. {
  31. return RT_EOK;
  32. }
  33. static void testcase(void)
  34. {
  35. UTEST_UNIT_RUN(test_assert_pass);
  36. }
  37. UTEST_TC_EXPORT(testcase, "testcases.utest.pass_tc", utest_tc_init, utest_tc_cleanup, 10);