1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 13:04:28 +01:00

Added several Dot11 tests, fixed some bugs on Dot11.

This commit is contained in:
Matias Fontanini
2012-08-24 00:20:36 -03:00
parent 9cd0e40600
commit 6aa1d874a1
12 changed files with 700 additions and 222 deletions

View File

@@ -59,25 +59,8 @@ void test_equals(const Dot11Beacon& b1, const Dot11Beacon& b2) {
EXPECT_EQ(b1.interval(), b2.interval());
EXPECT_EQ(b1.timestamp(), b2.timestamp());
const Dot11Beacon::CapabilityInformation &info1 = b1.capabilities(),
&info2 = b2.capabilities();
EXPECT_EQ(info1.ess(), info2.ess());
EXPECT_EQ(info1.ibss(), info2.ibss());
EXPECT_EQ(info1.cf_poll(), info2.cf_poll());
EXPECT_EQ(info1.cf_poll_req(), info2.cf_poll_req());
EXPECT_EQ(info1.privacy(), info2.privacy());
EXPECT_EQ(info1.short_preamble(), info2.short_preamble());
EXPECT_EQ(info1.pbcc(), info2.pbcc());
EXPECT_EQ(info1.channel_agility(), info2.channel_agility());
EXPECT_EQ(info1.spectrum_mgmt(), info2.spectrum_mgmt());
EXPECT_EQ(info1.qos(), info2.qos());
EXPECT_EQ(info1.sst(), info2.sst());
EXPECT_EQ(info1.apsd(), info2.apsd());
EXPECT_EQ(info1.reserved(), info2.reserved());
EXPECT_EQ(info1.dsss_ofdm(), info2.dsss_ofdm());
EXPECT_EQ(info1.delayed_block_ack(), info2.delayed_block_ack());
EXPECT_EQ(info1.immediate_block_ack(), info2.immediate_block_ack());
test_equals(b1.capabilities(), b2.capabilities());
test_equals(
static_cast<const Dot11ManagementFrame&>(b1),
static_cast<const Dot11ManagementFrame&>(b2)
@@ -87,24 +70,7 @@ void test_equals(const Dot11Beacon& b1, const Dot11Beacon& b2) {
TEST_F(Dot11BeaconTest, DefaultConstructor) {
Dot11Beacon dot11;
test_equals_empty(static_cast<const Dot11ManagementFrame&>(dot11));
const Dot11Beacon::CapabilityInformation& info = dot11.capabilities();
EXPECT_EQ(info.ess(), 0);
EXPECT_EQ(info.ibss(), 0);
EXPECT_EQ(info.cf_poll(), 0);
EXPECT_EQ(info.cf_poll_req(), 0);
EXPECT_EQ(info.privacy(), 0);
EXPECT_EQ(info.short_preamble(), 0);
EXPECT_EQ(info.pbcc(), 0);
EXPECT_EQ(info.channel_agility(), 0);
EXPECT_EQ(info.spectrum_mgmt(), 0);
EXPECT_EQ(info.qos(), 0);
EXPECT_EQ(info.sst(), 0);
EXPECT_EQ(info.apsd(), 0);
EXPECT_EQ(info.reserved(), 0);
EXPECT_EQ(info.dsss_ofdm(), 0);
EXPECT_EQ(info.delayed_block_ack(), 0);
EXPECT_EQ(info.immediate_block_ack(), 0);
test_equals_empty(dot11.capabilities());
EXPECT_EQ(dot11.interval(), 0);
EXPECT_EQ(dot11.timestamp(), 0);