1111#include <zephyr/sys_clock.h>
1212
1313/** req and rem are both NULL */
14- void test_nanosleep_NULL_NULL ( void )
14+ ZTEST ( posix_apis , test_nanosleep_NULL_NULL )
1515{
1616 int r = nanosleep (NULL , NULL );
1717
@@ -24,7 +24,7 @@ void test_nanosleep_NULL_NULL(void)
2424 *
2525 * Expect rem to be the same when function returns
2626 */
27- void test_nanosleep_NULL_notNULL ( void )
27+ ZTEST ( posix_apis , test_nanosleep_NULL_notNULL )
2828{
2929 struct timespec rem = {};
3030
@@ -45,7 +45,7 @@ void test_nanosleep_NULL_notNULL(void)
4545 *
4646 * Expect req to be the same when function returns
4747 */
48- void test_nanosleep_notNULL_NULL ( void )
48+ ZTEST ( posix_apis , test_nanosleep_notNULL_NULL )
4949{
5050 struct timespec req = {};
5151
@@ -65,7 +65,7 @@ void test_nanosleep_notNULL_NULL(void)
6565 *
6666 * Expect req & rem to be the same when function returns
6767 */
68- void test_nanosleep_notNULL_notNULL ( void )
68+ ZTEST ( posix_apis , test_nanosleep_notNULL_notNULL )
6969{
7070 struct timespec req = {};
7171 struct timespec rem = {};
@@ -91,7 +91,7 @@ void test_nanosleep_notNULL_notNULL(void)
9191 * Normative spec says they may be the same.
9292 * Expect rem to be zero after returning.
9393 */
94- void test_nanosleep_req_is_rem ( void )
94+ ZTEST ( posix_apis , test_nanosleep_req_is_rem )
9595{
9696 struct timespec ts = {0 , 1 };
9797
@@ -107,7 +107,7 @@ void test_nanosleep_req_is_rem(void)
107107}
108108
109109/** req tv_sec is -1 */
110- void test_nanosleep_n1_0 ( void )
110+ ZTEST ( posix_apis , test_nanosleep_n1_0 )
111111{
112112 struct timespec req = {-1 , 0 };
113113
@@ -119,7 +119,7 @@ void test_nanosleep_n1_0(void)
119119}
120120
121121/** req tv_nsec is -1 */
122- void test_nanosleep_0_n1 ( void )
122+ ZTEST ( posix_apis , test_nanosleep_0_n1 )
123123{
124124 struct timespec req = {0 , -1 };
125125
@@ -131,7 +131,7 @@ void test_nanosleep_0_n1(void)
131131}
132132
133133/** req tv_sec and tv_nsec are both -1 */
134- void test_nanosleep_n1_n1 ( void )
134+ ZTEST ( posix_apis , test_nanosleep_n1_n1 )
135135{
136136 struct timespec req = {-1 , -1 };
137137
@@ -143,7 +143,7 @@ void test_nanosleep_n1_n1(void)
143143}
144144
145145/** req tv_sec is 0 tv_nsec is 10^9 */
146- void test_nanosleep_0_1000000000 ( void )
146+ ZTEST ( posix_apis , test_nanosleep_0_1000000000 )
147147{
148148 struct timespec req = {0 , 1000000000 };
149149
@@ -191,37 +191,37 @@ static void common(const uint32_t s, uint32_t ns)
191191}
192192
193193/** sleep for 1ns */
194- void test_nanosleep_0_1 ( void )
194+ ZTEST ( posix_apis , test_nanosleep_0_1 )
195195{
196196 common (0 , 1 );
197197}
198198
199199/** sleep for 1us + 1ns */
200- void test_nanosleep_0_1001 ( void )
200+ ZTEST ( posix_apis , test_nanosleep_0_1001 )
201201{
202202 common (0 , 1001 );
203203}
204204
205205/** sleep for 500000000ns */
206- void test_nanosleep_0_500000000 ( void )
206+ ZTEST ( posix_apis , test_nanosleep_0_500000000 )
207207{
208208 common (0 , 500000000 );
209209}
210210
211211/** sleep for 1s */
212- void test_nanosleep_1_0 ( void )
212+ ZTEST ( posix_apis , test_nanosleep_1_0 )
213213{
214214 common (1 , 0 );
215215}
216216
217217/** sleep for 1s + 1ns */
218- void test_nanosleep_1_1 ( void )
218+ ZTEST ( posix_apis , test_nanosleep_1_1 )
219219{
220220 common (1 , 1 );
221221}
222222
223223/** sleep for 1s + 1us + 1ns */
224- void test_nanosleep_1_1001 ( void )
224+ ZTEST ( posix_apis , test_nanosleep_1_1001 )
225225{
226226 common (1 , 1001 );
227227}
0 commit comments