@@ -29,8 +29,7 @@ ZTEST(native_cpu_hold, test_cpu_hold_basic)
2929 k_busy_wait (wait_times [i ]);
3030 time2 = posix_get_hw_cycle ();
3131 zassert_true (time2 - time1 == wait_times [i ],
32- "k_busy_wait failed "
33- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
32+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
3433 time2 , time1 , wait_times [i ]);
3534 time1 = time2 ;
3635 }
@@ -39,8 +38,7 @@ ZTEST(native_cpu_hold, test_cpu_hold_basic)
3938 posix_cpu_hold (wait_times [i ]);
4039 time2 = posix_get_hw_cycle ();
4140 zassert_true (time2 - time1 == wait_times [i ],
42- "posix_cpu_hold failed "
43- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
41+ "posix_cpu_hold failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
4442 time2 , time1 , wait_times [i ]);
4543 time1 = time2 ;
4644 }
@@ -125,9 +123,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_another_thread)
125123 time2 = posix_get_hw_cycle ();
126124
127125 zassert_true (time2 - time1 == TWO_TICKS_TIME + WASTED_TIME ,
128- "k_busy_wait failed "
129- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
130- time2 , time1 , TWO_TICKS_TIME + WASTED_TIME );
126+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
127+ time2 , time1 , (uint32_t )(TWO_TICKS_TIME + WASTED_TIME ));
131128
132129 k_sem_take (& end_sema , K_FOREVER );
133130
@@ -143,9 +140,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_another_thread)
143140 time2 = posix_get_hw_cycle ();
144141
145142 zassert_true (time2 - time1 == TWO_AND_HALF_TICKS ,
146- "k_busy_wait failed "
147- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
148- time2 , time1 , TWO_AND_HALF_TICKS );
143+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
144+ time2 , time1 , (uint32_t )TWO_AND_HALF_TICKS );
149145
150146 k_sem_take (& end_sema , K_FOREVER );
151147
@@ -163,9 +159,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_another_thread)
163159 time2 = posix_get_hw_cycle ();
164160
165161 zassert_true (time2 - time1 == TWO_TICKS_TIME + WASTED_TIME + 1 ,
166- "k_busy_wait failed "
167- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
168- time2 , time1 , TWO_TICKS_TIME + WASTED_TIME + 1 );
162+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
163+ time2 , time1 , (uint32_t )(TWO_TICKS_TIME + WASTED_TIME + 1 ));
169164
170165 k_sem_take (& end_sema , K_FOREVER );
171166
@@ -183,9 +178,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_another_thread)
183178 time2 = posix_get_hw_cycle ();
184179
185180 zassert_true (time2 - time1 == TWO_AND_HALF_TICKS + WASTED_TIME ,
186- "k_busy_wait failed "
187- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
188- time2 , time1 , TWO_AND_HALF_TICKS + WASTED_TIME );
181+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
182+ time2 , time1 , (uint32_t )(TWO_AND_HALF_TICKS + WASTED_TIME ));
189183
190184 k_sem_take (& end_sema , K_FOREVER );
191185}
@@ -234,9 +228,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_interrupts)
234228 time2 = posix_get_hw_cycle ();
235229
236230 zassert_true (time2 - time1 == ONE_TICK_TIME + WASTED_TIME ,
237- "k_busy_wait failed "
238- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
239- time2 , time1 , ONE_TICK_TIME );
231+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
232+ time2 , time1 , (uint32_t )ONE_TICK_TIME );
240233
241234
242235 k_sleep (Z_TIMEOUT_TICKS (1 )); /* Wait until tick boundary */
@@ -250,9 +243,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_interrupts)
250243 time2 = posix_get_hw_cycle ();
251244
252245 zassert_true (time2 - time1 == ONE_AND_HALF_TICKS ,
253- "k_busy_wait failed "
254- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
255- time2 , time1 , ONE_TICK_TIME );
246+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
247+ time2 , time1 , (uint32_t )ONE_TICK_TIME );
256248
257249
258250
@@ -267,9 +259,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_interrupts)
267259 time2 = posix_get_hw_cycle ();
268260
269261 zassert_true (time2 - time1 == ONE_TICK_TIME + 1 + WASTED_TIME ,
270- "k_busy_wait failed "
271- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
272- time2 , time1 , ONE_TICK_TIME );
262+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
263+ time2 , time1 , (uint32_t )ONE_TICK_TIME );
273264
274265
275266 k_sleep (Z_TIMEOUT_TICKS (1 )); /* Wait until tick boundary */
@@ -283,9 +274,8 @@ ZTEST(native_cpu_hold, test_cpu_hold_with_interrupts)
283274 time2 = posix_get_hw_cycle ();
284275
285276 zassert_true (time2 - time1 == ONE_AND_HALF_TICKS + WASTED_TIME ,
286- "k_busy_wait failed "
287- PRIu64 "-" PRIu64 "!=" PRIu32 "\n" ,
288- time2 , time1 , ONE_TICK_TIME );
277+ "k_busy_wait failed %" PRIu64 "-%" PRIu64 "!=%" PRIu32 "\n" ,
278+ time2 , time1 , (uint32_t )ONE_TICK_TIME );
289279
290280#endif /* defined(CONFIG_BOARD_NATIVE_SIM) */
291281}
0 commit comments