Skip to content

Commit 1b43893

Browse files
committed
test: added case for loopback address
1 parent 4016455 commit 1b43893

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/net/unit/ip4_addr.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,17 @@ CASE("IP4 addresses can be compared to each other")
8686
const Addr expected_result { 192,168,1,0 };
8787
EXPECT( result == expected_result );
8888
}
89+
90+
CASE("Determine if an address is loopback")
91+
{
92+
Addr l1 { 127,0,0,1 };
93+
Addr l2 { 127,10,0,42 };
94+
Addr l3 { 127,255,255,255 };
95+
Addr no { 128,0,0,2 };
96+
97+
EXPECT(l1.is_loopback());
98+
EXPECT(l2.is_loopback());
99+
EXPECT(l3.is_loopback());
100+
EXPECT(not no.is_loopback());
101+
102+
}

0 commit comments

Comments
 (0)