|
1 | 1 | /* |
2 | | - * Copyright (c) 2018 Intel Corporation. |
| 2 | + * Copyright (c) 2018,2022 Intel Corporation. |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -37,7 +37,7 @@ volatile int bounce_owner, bounce_done; |
37 | 37 | * |
38 | 38 | * @see k_spin_lock(), k_spin_unlock() |
39 | 39 | */ |
40 | | -void test_spinlock_basic(void) |
| 40 | +ZTEST(spinlock, test_spinlock_basic) |
41 | 41 | { |
42 | 42 | k_spinlock_key_t key; |
43 | 43 | static struct k_spinlock l; |
@@ -111,7 +111,7 @@ void cpu1_fn(void *p1, void *p2, void *p3) |
111 | 111 | * |
112 | 112 | * @see arch_start_cpu() |
113 | 113 | */ |
114 | | -void test_spinlock_bounce(void) |
| 114 | +ZTEST(spinlock, test_spinlock_bounce) |
115 | 115 | { |
116 | 116 | int i; |
117 | 117 |
|
@@ -140,7 +140,7 @@ void test_spinlock_bounce(void) |
140 | 140 | * |
141 | 141 | * @see k_spin_lock(), k_spin_unlock() |
142 | 142 | */ |
143 | | -void test_spinlock_mutual_exclusion(void) |
| 143 | +ZTEST(spinlock, test_spinlock_mutual_exclusion) |
144 | 144 | { |
145 | 145 | k_spinlock_key_t key; |
146 | 146 | static struct k_spinlock lock_runtime; |
@@ -173,20 +173,4 @@ void test_spinlock_mutual_exclusion(void) |
173 | 173 | zassert_true(!lock_runtime.locked, "Spinlock failed to unlock"); |
174 | 174 | } |
175 | 175 |
|
176 | | - |
177 | | -extern void test_spinlock_no_recursive(void); |
178 | | -extern void test_spinlock_unlock_error(void); |
179 | | -extern void test_spinlock_release_error(void); |
180 | | - |
181 | | - |
182 | | -void test_main(void) |
183 | | -{ |
184 | | - ztest_test_suite(spinlock, |
185 | | - ztest_unit_test(test_spinlock_basic), |
186 | | - ztest_unit_test(test_spinlock_bounce), |
187 | | - ztest_unit_test(test_spinlock_mutual_exclusion), |
188 | | - ztest_unit_test(test_spinlock_no_recursive), |
189 | | - ztest_unit_test(test_spinlock_unlock_error), |
190 | | - ztest_unit_test(test_spinlock_release_error)); |
191 | | - ztest_run_test_suite(spinlock); |
192 | | -} |
| 176 | +ZTEST_SUITE(spinlock, NULL, NULL, NULL, NULL, NULL); |
0 commit comments