1 #include <zephyr/ztest.h>
2
expect_two_parameters(int a,int b)3 static void expect_two_parameters(int a, int b)
4 {
5 ztest_check_expected_value(a);
6 ztest_check_expected_value(b);
7 }
8
parameter_tests(void)9 static void parameter_tests(void)
10 {
11 ztest_expect_value(expect_two_parameters, a, 2);
12 ztest_expect_value(expect_two_parameters, b, 3);
13 expect_two_parameters(2, 3);
14 }
15
returns_int(void)16 static int returns_int(void)
17 {
18 return ztest_get_return_value();
19 }
20
return_value_tests(void)21 static void return_value_tests(void)
22 {
23 ztest_returns_value(returns_int, 5);
24 zassert_equal(returns_int(), 5, NULL);
25 }
26
test_main(void)27 void test_main(void)
28 {
29 ztest_test_suite(mock_framework_tests,
30 ztest_unit_test(parameter_test),
31 ztest_unit_test(return_value_test)
32 );
33
34 ztest_run_test_suite(mock_framework_tests);
35 }
36