src/connectivity/wlan/drivers/testing/lib/sim-env/test/event_unittests.cc
// Attempt to add event before current time
Attempt to add event before current time
Attempt to add event before current time
TEST_F(EventTest, InvalidTime) {
  constexpr zx::duration delay = zx::msec(-100);
  auto handler = std::make_unique<std::function<void()>>();
  *handler = std::bind(&EventTest::SingleEventCallback, this);
  EXPECT_EQ(env_.ScheduleNotification(std::move(handler), delay), ZX_ERR_INVALID_ARGS);
  env_.Run();
  EXPECT_EQ(completed_, false);
  EXPECT_EQ(env_.GetTime(), ABSOLUTE_TIME(zx::usec(0)));
}
TEST_F ( EventTest , InvalidTime ) { constexpr zx :: duration delay = zx :: msec ( -100 ) ; auto handler = std :: make_unique < std :: function < void ( ) > > ( ) ; * handler = std :: bind ( & EventTest :: SingleEventCallback , this ) ; EXPECT_EQ ( env_ . ScheduleNotification ( std :: move ( handler ) , delay ) , ZX_ERR_INVALID_ARGS ) ; env_ . Run ( ) ; EXPECT_EQ ( completed_ , false ) ; EXPECT_EQ ( env_ . GetTime ( ) , ABSOLUTE_TIME ( zx :: usec ( 0 ) ) ) ; }
Attempt to add event before current time
Attempt to add event before current time
// Time should not have advanced