Skip to content

Commit

Permalink
Avoid infinite loop on tests in case of detection failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-rabault committed Nov 13, 2023
1 parent d31aca1 commit e4536db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/_resources/Scenarios/default_scenario.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,16 @@ static void Detection(service_t *service)
search_result_t result;

Luos_Detect(service);
uint32_t started_time = Luos_GetSystick();
do
{
Luos_Loop();
if (Luos_GetSystick() - started_time > 10000)
{
printf("[FATAL] Detection failed\n");
TEST_ASSERT_TRUE(0);
return;
}
} while (!Luos_IsDetected());

RTFilter_Reset(&result);
Expand Down

0 comments on commit e4536db

Please sign in to comment.