src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/test/timer_test.cc
// This test creates a one-shot timer and checks if timer_set can be called
// from within the handler itself and a second timer is created to ensure
// calling timer_set() from within the handler does not have any side-effects
This test creates a one-shot timer and checks if timer_set can be called
from within the handler itself and a second timer is created to ensure
calling timer_set() from within the handler does not have any side-effects
This test creates a one - shot timer and checks if timer_set can be called from within the handler itself and a second timer is created to ensure calling timer_set () from within the handler does not have any side - effects
TEST_F(TimerTest, timerset_in_handler) {
  TestTimerCfg timer(GetFakeDrvr(), GetQueue(), ZX_MSEC(10), 2, false, true, false);
  TestTimerCfg timer2(GetFakeDrvr(), GetQueue(), ZX_MSEC(25), 1, false, false, false);
  zx_status_t status = sync_completion_wait(&timer2.wait_for_timer, ZX_TIME_INFINITE);
  EXPECT_EQ(status, ZX_OK);
  timer2.timer.Stop();
  status = sync_completion_wait(&timer.wait_for_timer, ZX_TIME_INFINITE);
  EXPECT_EQ(status, ZX_OK);
  timer.timer.Stop();
  EXPECT_EQ(timer.timer_cnt, 2U);
  EXPECT_EQ(timer2.timer_cnt, 1U);
}
TEST_F ( TimerTest , timerset_in_handler ) { TestTimerCfg timer ( GetFakeDrvr ( ) , GetQueue ( ) , ZX_MSEC ( 10 ) , 2 , false , true , false ) ; TestTimerCfg timer2 ( GetFakeDrvr ( ) , GetQueue ( ) , ZX_MSEC ( 25 ) , 1 , false , false , false ) ; zx_status_t status = sync_completion_wait ( & timer2 . wait_for_timer , ZX_TIME_INFINITE ) ; EXPECT_EQ ( status , ZX_OK ) ; timer2 . timer . Stop ( ) ; status = sync_completion_wait ( & timer . wait_for_timer , ZX_TIME_INFINITE ) ; EXPECT_EQ ( status , ZX_OK ) ; timer . timer . Stop ( ) ; EXPECT_EQ ( timer . timer_cnt , 2U ) ; EXPECT_EQ ( timer2 . timer_cnt , 1U ) ; }
This test creates a one-shot timer and checks if timer_set can be called
from within the handler itself and a second timer is created to ensure
calling timer_set() from within the handler does not have any side-effects
This test creates a one - shot timer and checks if timer_set can be called from within the handler itself and a second timer is created to ensure calling timer_set () from within the handler does not have any side - effects
// A timerset will be called inside callback // Setup a second timer and ensure it runs ok too // Check to make sure the first timer fired exactly twice and the second once