src/connectivity/wlan/drivers/testing/lib/sim-fake-ap/test/assoc_unittests.cc
TEST_F(AssocTest, IgnoredRequests) {
  constexpr wlan_channel_t kWrongChannel = {
      .primary = 10, .cbw = WLAN_CHANNEL_BANDWIDTH__20, .secondary80 = 0};
  static const common::MacAddr kWrongBssid({0x12, 0x34, 0x56, 0x78, 0x9a, 0xbd});

  // Schedule assoc req on different channel
  auto handler = new std::function<void()>;
  *handler = std::bind(&simulation::Environment::TxAssocReq, &env_, this, kWrongChannel,
                       kClientMacAddr, kApBssid);
  env_.ScheduleNotification(this, zx::sec(1), static_cast<void*>(handler));

  // Schedule assoc req to different bssid
  handler = new std::function<void()>;
  *handler = std::bind(&simulation::Environment::TxAssocReq, &env_, this, kDefaultChannel,
                       kClientMacAddr, kWrongBssid);
  env_.ScheduleNotification(this, zx::sec(2), static_cast<void*>(handler));

  env_.Run();

  // Verify that no assoc responses were seen in the environment
  EXPECT_EQ(assoc_resp_count_, 0U);
}
/* Verify that association requests that are not properly addressed are ignored.

   Timeline for this test:
   1s: send assoc request on different channel
   2s: send assoc request with different bssid
 */
Verify that association requests that are not properly addressed are ignored.
Timeline for this test:
1s: send assoc request on different channel
2s: send assoc request with different bssid
Verify that association requests that are not properly addressed are ignored . Timeline for this test : 1s : send assoc request on different channel 2s : send assoc request with different bssid
TEST_F(AssocTest, IgnoredRequests) {
  constexpr wlan_channel_t kWrongChannel = {
      .primary = 10, .cbw = WLAN_CHANNEL_BANDWIDTH__20, .secondary80 = 0};
  static const common::MacAddr kWrongBssid({0x12, 0x34, 0x56, 0x78, 0x9a, 0xbd});
  auto handler = new std::function<void()>;
  *handler = std::bind(&simulation::Environment::TxAssocReq, &env_, this, kWrongChannel,
                       kClientMacAddr, kApBssid);
  env_.ScheduleNotification(this, zx::sec(1), static_cast<void*>(handler));
  handler = new std::function<void()>;
  *handler = std::bind(&simulation::Environment::TxAssocReq, &env_, this, kDefaultChannel,
                       kClientMacAddr, kWrongBssid);
  env_.ScheduleNotification(this, zx::sec(2), static_cast<void*>(handler));
  env_.Run();
  EXPECT_EQ(assoc_resp_count_, 0U);
}
TEST_F ( AssocTest , IgnoredRequests ) { constexpr wlan_channel_t kWrongChannel = { . primary = 10 , . cbw = WLAN_CHANNEL_BANDWIDTH__20 , . secondary80 = 0 } ; static const common :: MacAddr kWrongBssid ( { 0x12 , 0x34 , 0x56 , 0x78 , 0x9a , 0xbd } ) ; auto handler = new std :: function < void ( ) > ; * handler = std :: bind ( & simulation :: Environment :: TxAssocReq , & env_ , this , kWrongChannel , kClientMacAddr , kApBssid ) ; env_ . ScheduleNotification ( this , zx :: sec ( 1 ) , static_cast < void * > ( handler ) ) ; handler = new std :: function < void ( ) > ; * handler = std :: bind ( & simulation :: Environment :: TxAssocReq , & env_ , this , kDefaultChannel , kClientMacAddr , kWrongBssid ) ; env_ . ScheduleNotification ( this , zx :: sec ( 2 ) , static_cast < void * > ( handler ) ) ; env_ . Run ( ) ; EXPECT_EQ ( assoc_resp_count_ , 0U ) ; }
Verify that association requests that are not properly addressed are ignored.
Verify that association requests that are not properly addressed are ignored .
// Schedule assoc req on different channel // Schedule assoc req to different bssid // Verify that no assoc responses were seen in the environment