@@ -270,13 +270,25 @@ ZTEST(comparator_shell, test_await_trigger_timeout)
270
270
271
271
shell_backend_dummy_clear_output (test_sh );
272
272
comp_fake_comp_set_trigger_callback_fake .custom_fake = test_set_trigger_callback_stub_0 ;
273
+ /* Test default timeout (no timeout argument) */
273
274
ret = shell_execute_cmd (test_sh , "comp await_trigger " FAKE_COMP_NAME );
274
275
zassert_ok (ret );
275
276
zassert_equal (comp_fake_comp_set_trigger_callback_fake .call_count , 2 );
276
277
zassert_equal (comp_fake_comp_set_trigger_callback_fake .return_val_history [0 ], 0 );
277
278
zassert_equal (comp_fake_comp_set_trigger_callback_fake .return_val_history [1 ], 0 );
278
279
out = shell_backend_dummy_get_output (test_sh , & out_size );
279
280
zassert_str_equal (out , "\r\ntimed out\r\n" );
281
+
282
+ shell_backend_dummy_clear_output (test_sh );
283
+ comp_fake_comp_set_trigger_callback_fake .custom_fake = test_set_trigger_callback_stub_0 ;
284
+ /* Test with provided timeout argument (2 seconds) */
285
+ ret = shell_execute_cmd (test_sh , "comp await_trigger " FAKE_COMP_NAME " 2" );
286
+ zassert_ok (ret );
287
+ zassert_equal (comp_fake_comp_set_trigger_callback_fake .call_count , 4 );
288
+ zassert_equal (comp_fake_comp_set_trigger_callback_fake .return_val_history [2 ], 0 );
289
+ zassert_equal (comp_fake_comp_set_trigger_callback_fake .return_val_history [3 ], 0 );
290
+ out = shell_backend_dummy_get_output (test_sh , & out_size );
291
+ zassert_str_equal (out , "\r\ntimed out\r\n" );
280
292
}
281
293
282
294
ZTEST (comparator_shell , test_await_trigger_invalid_timeout_arg )
0 commit comments