Skip to content

Commit

Permalink
Fix the outstanding lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman committed Sep 20, 2023
1 parent 3cc1292 commit 87b1318
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion include/ola/network/IPV6Address.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ class IPV6Address {
* @note The address is copied in network byte order.
*/
void Get(uint8_t ptr[LENGTH]) const {
memcpy(ptr, reinterpret_cast<const uint8_t*>(&m_address.s6_addr[0]), LENGTH);
memcpy(ptr,
reinterpret_cast<const uint8_t*>(&m_address.s6_addr[0]),
LENGTH);
}

/**
Expand Down
15 changes: 10 additions & 5 deletions olad/plugin_api/PreferencesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,25 @@ void PreferencesTest::testValidators() {
OLA_ASSERT(ipv6_validator.IsValid("::ffff:1.2.3.4"));
OLA_ASSERT(ipv6_validator.IsValid("::ffff:10.0.255.1"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid("foo"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid("2001:db8:1234:5678:90ab:cdef:feed:face:0000"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid("2001:db8:1234:5678:90ab:cdef:feed:gggg"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid(
"2001:db8:1234:5678:90ab:cdef:feed:face:0000"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid(
"2001:db8:1234:5678:90ab:cdef:feed:gggg"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid("::ffff:1.2.3"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid("::ffff:1.2.3.4.5"));
OLA_ASSERT_FALSE(ipv6_validator.IsValid("::ffff:1.f00.3.4"));

IPv6Validator ipv6_validator2(false); // empty not ok
OLA_ASSERT_FALSE(ipv6_validator2.IsValid(""));
OLA_ASSERT(ipv6_validator2.IsValid("2001:db8:1234:5678:90ab:cdef:feed:face"));
OLA_ASSERT(ipv6_validator2.IsValid(
"2001:db8:1234:5678:90ab:cdef:feed:face"));
OLA_ASSERT(ipv6_validator2.IsValid("::ffff:1.2.3.4"));
OLA_ASSERT(ipv6_validator2.IsValid("::ffff:10.0.255.1"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid("foo"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid("2001:db8:1234:5678:90ab:cdef:feed:face:0000"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid("2001:db8:1234:5678:90ab:cdef:feed:gggg"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid(
"2001:db8:1234:5678:90ab:cdef:feed:face:0000"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid(
"2001:db8:1234:5678:90ab:cdef:feed:gggg"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid("::ffff:1.2.3"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid("::ffff:1.2.3.4.5"));
OLA_ASSERT_FALSE(ipv6_validator2.IsValid("::ffff:1.f00.3.4"));
Expand Down

0 comments on commit 87b1318

Please sign in to comment.