From ae952abd9d185b99f4ecaa32feb9ccd515ab6ba6 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Wed, 15 Jan 2020 19:07:23 +0300 Subject: [PATCH] wifi: add testcases for issue #107 --- src/wifi/test/wifi-phy-reception-test.cc | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index 6c8dfdaa1..09200bfeb 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -841,6 +841,35 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void) // In this case, the second packet should be marked as a failure Simulator::Schedule (Seconds (17.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 6); + rxPowerDbm = -50; + // CASE 18: send two packets with second one 50 dB higher within the 4us window + + Simulator::Schedule (Seconds (18.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); + Simulator::Schedule (Seconds (18.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm+50); + // The second packet should be received successfully + Simulator::Schedule (Seconds (18.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 3, 6); + + // CASE 19: send two packets with second one 10 dB higher within the 4us window + + Simulator::Schedule (Seconds (19.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); + Simulator::Schedule (Seconds (19.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm+10); + // The second packet should be captured, but not decoded since SNR to low for used MCS + Simulator::Schedule (Seconds (19.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 3, 7); + + // CASE 20: send two packets with second one 50 dB higher in the same time + + Simulator::Schedule (Seconds (20.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); + Simulator::Schedule (Seconds (20.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm+50); + // The second packet should be received successfully, same as in CASE 13 + Simulator::Schedule (Seconds (20.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 4, 7); + + // CASE 21: send two packets with second one 10 dB higher in the same time + + Simulator::Schedule (Seconds (21.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); + Simulator::Schedule (Seconds (21.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm+10); + // The second packet should be captured, but not decoded since SNR to low for used MCS, same as in CASE 19 + Simulator::Schedule (Seconds (21.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 4, 8); + Simulator::Run (); Simulator::Destroy (); }