diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/src/radiotap.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/src/radiotap.cpp b/tests/src/radiotap.cpp index ec2453c..c6ff43b 100644 --- a/tests/src/radiotap.cpp +++ b/tests/src/radiotap.cpp @@ -9,6 +9,8 @@ #include "dot11/dot11_data.h" #include "dot11/dot11_beacon.h" #include "arp.h" +#include "snap.h" +#include "eapol.h" #include "utils.h" using namespace std; @@ -379,4 +381,23 @@ TEST_F(RadioTapTest, TSFT) { EXPECT_EQ(radio.tsft(), 0x7afb9a8dU); } +TEST_F(RadioTapTest, SerializationWorksFine) { + const uint8_t expected[] = { + 0, 0, 26, 0, 43, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 108, + 9, 160, 0, 206, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 170, 170, 3, 0, 0, 0, 136, 142, + 1, 3, 0, 95, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 43, 4, 210 + }; + RadioTap radio = RadioTap() / Dot11Data() / SNAP() / RSNEAPOL(); + RadioTap::serialization_type buffer = radio.serialize(); + EXPECT_EQ( + RadioTap::serialization_type(expected, expected + sizeof(expected)), + buffer + ); +} + #endif // HAVE_DOT11 |
