mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
AK: Test that IPv6Address::operator== only looks at bytes in address
This commit extends the test to ensure that different objects with the same inet6-address are considered equal.
This commit is contained in:
parent
1051624084
commit
43a8a38f57
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/peterbb Commit: https://github.com/SerenityOS/serenity/commit/43a8a38f57 Pull-request: https://github.com/SerenityOS/serenity/pull/19139 Reviewed-by: https://github.com/Dexesttp Reviewed-by: https://github.com/gmta
1 changed files with 4 additions and 1 deletions
|
@ -105,14 +105,17 @@ TEST_CASE(should_make_empty_optional_from_out_of_range_values)
|
|||
EXPECT(!addr.has_value());
|
||||
}
|
||||
|
||||
TEST_CASE(should_compare)
|
||||
TEST_CASE(should_only_compare_bytes_from_address)
|
||||
{
|
||||
constexpr IPv6Address addr_a({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 });
|
||||
constexpr IPv6Address addr_b({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17 });
|
||||
constexpr IPv6Address addr_c({ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17 });
|
||||
|
||||
static_assert(addr_a != addr_b);
|
||||
static_assert(addr_a == addr_a);
|
||||
static_assert(addr_b == addr_c);
|
||||
|
||||
EXPECT(addr_a != addr_b);
|
||||
EXPECT(addr_a == addr_a);
|
||||
EXPECT(addr_b == addr_c);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue