Skip to content

Commit 95737cd

Browse files
nordic-krchkartben
authored andcommitted
tests: boards: Fix zassert string
Fix wrong parameter used in zassert macros. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 07a729b commit 95737cd

File tree

3 files changed

+33
-43
lines changed

3 files changed

+33
-43
lines changed

tests/boards/intel_adsp/cache/src/main.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@ ZTEST(adsp_cache, test_adsp_cache_flush_inv_all)
1919
*uncached = 40;
2020

2121
/* Just some sanity checks */
22-
zassert_equal(*cached, 42, NULL);
23-
zassert_equal(*uncached, 40, NULL);
22+
zassert_equal(*cached, 42);
23+
zassert_equal(*uncached, 40);
2424

2525
sys_cache_data_flush_and_invd_all();
2626

2727
/* After sys_cache_data_flush_and_invd_all(), uncached should be updated */
28-
zassert_equal(*cached, 42, NULL);
29-
zassert_equal(*uncached, 42, NULL);
28+
zassert_equal(*cached, 42);
29+
zassert_equal(*uncached, 42);
3030

3131
/* Flush and invalidate again, this time to check the invalidate part */
3232
sys_cache_data_flush_and_invd_all();
3333
*uncached = 80;
3434

3535
/* As cache is invalid, cached should be updated with uncached new value */
36-
zassert_equal(*cached, 80, NULL);
37-
zassert_equal(*uncached, 80, NULL);
36+
zassert_equal(*cached, 80);
37+
zassert_equal(*uncached, 80);
3838

3939
*cached = 82;
4040

4141
/* Only cached should have changed */
42-
zassert_equal(*cached, 82, NULL);
43-
zassert_equal(*uncached, 80, NULL);
42+
zassert_equal(*cached, 82);
43+
zassert_equal(*uncached, 80);
4444

4545
sys_cache_data_flush_all();
4646

4747
/* After sys_cache_data_flush_all(), uncached should be updated */
48-
zassert_equal(*cached, 82, NULL);
49-
zassert_equal(*uncached, 82, NULL);
48+
zassert_equal(*cached, 82);
49+
zassert_equal(*uncached, 82);
5050

5151
*uncached = 100;
5252

5353
/* As cache is not invalid, only uncached should be updated */
54-
zassert_equal(*cached, 82, NULL);
55-
zassert_equal(*uncached, 100, NULL);
54+
zassert_equal(*cached, 82);
55+
zassert_equal(*uncached, 100);
5656

5757
sys_cache_data_invd_all();
5858

5959
/* Now, cached should be updated */
60-
zassert_equal(*cached, 100, NULL);
61-
zassert_equal(*uncached, 100, NULL);
60+
zassert_equal(*cached, 100);
61+
zassert_equal(*uncached, 100);
6262
}
6363

6464
ZTEST_SUITE(adsp_cache, NULL, NULL, NULL, NULL, NULL);

tests/boards/intel_adsp/smoke/src/cpus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static void core_smoke(void *arg)
123123
int32_t diff = MAX(1, abs(clk_ratios[i] - clk_ratios[cpu]));
124124

125125
zassert_true((clk_ratios[cpu] / diff) > 100,
126-
"clocks off by more than 1%");
126+
"clocks off by more than 1%%");
127127
}
128128

129129
/* Check tight loop performance to validate instruction cache */

tests/boards/native_sim/cpu_wait/src/main.c

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)