1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 20:44:26 +01:00

Fixed some endianness bugs on ICMPv6 and PPI.

This commit is contained in:
Matias Fontanini
2014-01-19 14:40:57 -03:00
parent 853e1ce647
commit 6d7e06535a
3 changed files with 35 additions and 28 deletions

View File

@@ -223,19 +223,24 @@ TEST_F(ICMPv6Test, MTU) {
TEST_F(ICMPv6Test, ShortcutLimit) {
ICMPv6 icmp;
icmp.shortcut_limit(123);
ICMPv6::shortcut_limit_type slimit(123);
slimit.reserved1 = 0x7f;
slimit.reserved2 = 0x12345678;
icmp.shortcut_limit(slimit);
ICMPv6::shortcut_limit_type sl = icmp.shortcut_limit();
EXPECT_EQ(123, sl.limit);
EXPECT_EQ(0, sl.reserved1);
EXPECT_EQ(0, sl.reserved2);
EXPECT_EQ(0x7f, sl.reserved1);
EXPECT_EQ(0x12345678, sl.reserved2);
}
TEST_F(ICMPv6Test, NewAdvertisementInterval) {
ICMPv6 icmp;
icmp.new_advert_interval(0x9a8df7);
ICMPv6::new_advert_interval_type adv(0x9a8df7);
adv.reserved = 0x1234;
icmp.new_advert_interval(adv);
ICMPv6::new_advert_interval_type data = icmp.new_advert_interval();
EXPECT_EQ(0x9a8df7U, data.interval);
EXPECT_EQ(0, data.reserved);
EXPECT_EQ(0x1234, data.reserved);
}
TEST_F(ICMPv6Test, NewHomeAgentInformation) {