-
Notifications
You must be signed in to change notification settings - Fork 721
Added Common++ unit test project based on Gtest. #1507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Dimi1010
wants to merge
102
commits into
seladb:dev
Choose a base branch
from
Dimi1010:feature/gtest-framework
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
5f02028
Added Common++ unit test project based on Gtest.
Dimi1010 0687ddd
Fixed includes.
Dimi1010 a004e3c
Changed gtest version to 1.12 which is the last to support Cpp11.
Dimi1010 94a3b0e
Added Gmock in addition to Gtest.
Dimi1010 be20d78
Added IPv6 tests.
Dimi1010 3395ac7
Added IPAddress tests.
Dimi1010 55fdf10
Lint
Dimi1010 f447d9c
Fixed matcher error.
Dimi1010 5b37a1f
Added _ipv4 and _ipv6 string literals.
Dimi1010 12e4599
Added IPv4 Network unit tests.
Dimi1010 0f20bb9
Added IPv6 Network unit tests.
Dimi1010 a2718d8
Added IPNetwork unit tests.
Dimi1010 e29190a
Added more unit tests.
Dimi1010 0f3f927
Added IP(v4/v6)Address match network tests.
Dimi1010 c8d04de
Lint
Dimi1010 a67ebe7
Added MacAddress constructor from std::array.
Dimi1010 a93a202
Added MacAddress unit tests.
Dimi1010 66d1937
Added MacAddress tests for output to stream.
Dimi1010 aa92f72
Added unit tests for PointerVector and test fixture with built-in mem…
Dimi1010 d191cdb
Lint
Dimi1010 bd8ecd9
Included 'googletest' configuration for cppcheck.
Dimi1010 70708fd
Fixed include of MemoryLeakDetectorFixture... hopefully the correct way.
Dimi1010 d45b54d
Fixed wrong variable assert.
Dimi1010 a9cd1b8
Added unit test for functions in the general utilities header.
Dimi1010 4803471
Added unit tests for LRUList.
Dimi1010 9e77c18
Lint
Dimi1010 63a8fbe
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 d503bcd
Added cast to ptr type because direct nullptr is deleted function.
Dimi1010 bf9c3ca
Merge branch 'dev' into feature/gtest-framework
Dimi1010 f1baa83
Lint
Dimi1010 6b50130
Fixed issue with temporary.
Dimi1010 706fb4b
Merge branch 'dev' into feature/gtest-framework
Dimi1010 012df84
Lint - hopefully.
Dimi1010 e875c0b
Pulled operator << overloads into the 'pcpp' namespace to leverage AD…
Dimi1010 3a97325
Renamed MacAddress ToStream test to be consistent with IPAddress test…
Dimi1010 f07b0bf
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 01b5cc1
CMakeLists lint...
Dimi1010 ddf1d3a
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 c20e5d3
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 4b71919
Merge branch 'dev' into feature/gtest-framework
Dimi1010 2c461f0
Merge branch 'dev' into feature/gtest-framework
Dimi1010 db34edb
Split common unit tests into smaller tests.
Dimi1010 84d7d32
Added const qualifier to MacAddress::Zero.
Dimi1010 e9f7930
Lint
Dimi1010 1b02e45
Added basic single threaded logger unit tests.
Dimi1010 b09fc3c
Simplified logger fixture setup and teardown.
Dimi1010 977abb4
Added explicit main file.
Dimi1010 67c6a22
Added conditional skipping of memory leak checks for MSVC Release bui…
Dimi1010 e5cf5fb
Added build information to the test executable.
Dimi1010 5076d29
Added tests for CoreMask transformations.
Dimi1010 4d0c5d1
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 d7046d7
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 3fa3dfd
Removed make_unique usage.
Dimi1010 fc0ea18
Lint
Dimi1010 3c7285b
Added const to MacAddress::Broadcast static variable.
Dimi1010 e45d5a9
Added Broadcast unit test.
Dimi1010 6a88fd8
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 6fb03e8
Bump googletest to v1.16.0
Dimi1010 6722666
Added unit tests for DynamicObjectPool
Dimi1010 453943a
cmake formatting.
Dimi1010 21f16f5
Include cleanup
Dimi1010 4df5ddb
Added precompiled header
Dimi1010 2b9a148
Added unit tests for timespec to timeval conversions.
Dimi1010 3b4d4d3
Updated logger tests.
Dimi1010 782623d
Lint
Dimi1010 62d48da
Version print formatting.
Dimi1010 58aa8ec
Merge branch 'dev' into feature/gtest-framework
Dimi1010 bf81cbe
Added todo for googletest fetch content.
Dimi1010 5f8a763
Added common unit test to run_tests CI script.
Dimi1010 37cb883
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 dae7b6b
Lint
Dimi1010 40efcd5
Updated packet only to run common + packet suites.
Dimi1010 b76fa62
Fixed explicit ctor
Dimi1010 247da32
Updated run_tests_windows to have separate functions for calls to sub…
Dimi1010 463b632
Added common test to windows CI.
Dimi1010 bc03910
Lint
Dimi1010 44f6094
Delayed startup of tcpreplay until pcap++ tests.
Dimi1010 3d57ddd
Added tests for new functions.
Dimi1010 00e8f94
Merge branch 'dev' into feature/gtest-framework
Dimi1010 2b9a0ba
Fixed memory leak fixture not respecting mem leak checks.
Dimi1010 7a1d6d7
Changed MemoryLeak Fixture to default fixture under TEST macro.
Dimi1010 a3fddb8
Temporarely disabled memory leak fixture testing due to false positiv…
Dimi1010 68eaf83
Changed MemoryLeakFixture into a gtest listener.
Dimi1010 36bea65
Updated log tests to utilize functor object instead of static function.
Dimi1010 480f802
Reverted on test end back to free all memory.
Dimi1010 86a0e5b
Fixed visibility.
Dimi1010 a6cd38b
Lint
Dimi1010 5d8e0af
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 ac73ed8
Fix cppcheck warnings.
Dimi1010 1e0df40
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 532678a
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 fc2873d
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 a0f005a
Commented out memory leak warning as it is disabled in all modes.
Dimi1010 789a17e
Added googletest 1.16 to 3rdParty dependencies.
Dimi1010 9b4db8b
Added googletest to pre-commit exclusions.
Dimi1010 888a5a1
Fixup regex string.
Dimi1010 c98dff8
Disabled clang format for commented line.
Dimi1010 3f78f4d
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 5e477f1
Merge branch 'dev' into feature/gtest-framework
Dimi1010 29ff777
Merge remote-tracking branch 'upstream/dev' into feature/gtest-framework
Dimi1010 449c523
Revert "Added googletest 1.16 to 3rdParty dependencies."
Dimi1010 340e2af
Merge branch 'dev' into feature/gtest-framework
Dimi1010 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG release-1.12.0 | ||
) | ||
|
||
if(WIN32) | ||
# Prevent overriding the parent project's compiler/linker settings. | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
endif() | ||
|
||
FetchContent_MakeAvailable(googletest) | ||
|
||
|
||
add_executable( | ||
Common++Test | ||
Tests/IPAddressTests.cpp) | ||
|
||
target_link_libraries( | ||
Common++Test | ||
PRIVATE Common++ | ||
gtest | ||
gmock | ||
gmock_main | ||
) | ||
|
||
if(MSVC) | ||
# This executable requires getopt.h not available on VStudio | ||
target_link_libraries(Common++Test PRIVATE Getopt-for-Visual-Studio) | ||
endif() | ||
|
||
set_property(TARGET Common++Test PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Bin") | ||
set_property(TARGET Common++Test PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}/Bin") | ||
set_property(TARGET Common++Test PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/Bin") | ||
|
||
enable_testing() | ||
|
||
add_test( | ||
NAME Common++Test | ||
COMMAND $<TARGET_FILE:Common++Test> | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
#include <array> | ||
#include <cstring> | ||
#include <gtest/gtest.h> | ||
#include <gmock/gmock.h> | ||
|
||
#include "IpAddress.h" | ||
|
||
namespace pcpp | ||
{ | ||
TEST(IPv4AddressTest, IPv4AddressStatics) | ||
{ | ||
IPv4Address const& ipZero = IPv4Address::Zero; | ||
EXPECT_EQ(ipZero.toInt(), 0); | ||
EXPECT_EQ(ipZero.toString(), "0.0.0.0"); | ||
|
||
IPv4Address const& ipMulticastLower = IPv4Address::MulticastRangeLowerBound; | ||
EXPECT_EQ(ipMulticastLower.toInt(), 0x000000E0); | ||
EXPECT_EQ(ipMulticastLower.toString(), "224.0.0.0"); | ||
|
||
IPv4Address const& ipMulticastUpper = IPv4Address::MulticastRangeUpperBound; | ||
EXPECT_EQ(ipMulticastUpper.toInt(), 0xFFFFFFEF); | ||
EXPECT_EQ(ipMulticastUpper.toString(), "239.255.255.255"); | ||
|
||
EXPECT_TRUE(IPv4Address::isValidIPv4Address("222.146.254.245")); | ||
EXPECT_FALSE(IPv4Address::isValidIPv4Address("222.146.300.245")); | ||
EXPECT_FALSE(IPv4Address::isValidIPv4Address("bogus string")); | ||
}; | ||
|
||
TEST(IPv4AddressTest, IPv4AddressBasics) | ||
{ | ||
IPv4Address ipDefault; | ||
EXPECT_EQ(ipDefault.toInt(), 0); | ||
EXPECT_EQ(ipDefault.toString(), "0.0.0.0"); | ||
EXPECT_EQ(ipDefault, pcpp::IPv4Address::Zero); | ||
|
||
IPv4Address ipString("0.0.0.1"); | ||
EXPECT_EQ(ipString.toInt(), 0x01000000); | ||
EXPECT_EQ(ipString.toString(), "0.0.0.1"); | ||
EXPECT_THROW(IPv4Address("0.0.0.644"), std::invalid_argument) | ||
<< "IPv4Address does not throw for out of bounds IP string."; | ||
EXPECT_THROW(IPv4Address("bogusString"), std::invalid_argument) | ||
<< "IPv4Address does not throw for non-IP string."; | ||
|
||
IPv4Address ipUint32(0x085201A0); | ||
EXPECT_EQ(ipUint32.toInt(), 0x085201A0); | ||
EXPECT_EQ(ipUint32.toString(), "160.1.82.8"); | ||
|
||
std::array<uint8_t, 4> ipArrayBuffer = { 192, 100, 1, 1 }; | ||
IPv4Address ipUint8Raw(ipArrayBuffer.data()); | ||
EXPECT_EQ(ipUint8Raw.toInt(), 0x010164C0); | ||
EXPECT_EQ(ipUint8Raw.toString(), "192.100.1.1"); | ||
EXPECT_EQ(ipUint8Raw.toByteArray(), ipArrayBuffer); | ||
EXPECT_TRUE(0 == std::memcmp(ipArrayBuffer.data(), ipUint8Raw.toBytes(), 4)); | ||
|
||
IPv4Address ipUint8Array(ipArrayBuffer); | ||
EXPECT_EQ(ipUint8Array.toInt(), 0x010164C0); | ||
EXPECT_EQ(ipUint8Array.toString(), "192.100.1.1"); | ||
EXPECT_EQ(ipUint8Array.toByteArray(), ipArrayBuffer); | ||
EXPECT_TRUE(0 == std::memcmp(ipArrayBuffer.data(), ipUint8Array.toBytes(), 4)); | ||
|
||
EXPECT_TRUE(ipUint8Raw == ipUint8Array) << "Comparison operator '==' does not compare equal values correctly."; | ||
EXPECT_FALSE(ipUint8Raw == ipDefault) << "Comparison operator '==' does not compare unequal values correctly."; | ||
EXPECT_FALSE(ipUint8Raw != ipUint8Array) << "Comparison operator '!=' does not compare equal values correctly."; | ||
EXPECT_TRUE(ipUint8Raw != ipDefault) << "Comparison operator '!=' does not compare unequal values correctly."; | ||
|
||
EXPECT_TRUE(ipDefault < ipString) << "Comparison operator '<' does not compare less than values correctly."; | ||
EXPECT_FALSE(ipString < ipDefault) << "Comparison operator '<' does not compare less than values correctly."; | ||
}; | ||
|
||
TEST(IPv4AddressTest, Multicast) | ||
{ | ||
IPv4Address underMulticastBound(0x000000D1); | ||
EXPECT_FALSE(underMulticastBound.isMulticast()); | ||
|
||
IPv4Address atLowerMulticastBound(0x000000E0); | ||
EXPECT_TRUE(atLowerMulticastBound.isMulticast()); | ||
|
||
IPv4Address inMulticastRange(0x000000EF); | ||
EXPECT_TRUE(inMulticastRange.isMulticast()); | ||
|
||
IPv4Address atUpperMulticastBound(0xFFFFFFEF); | ||
EXPECT_TRUE(atUpperMulticastBound.isMulticast()); | ||
|
||
IPv4Address overMulticastBound(0x000000F0); | ||
EXPECT_FALSE(overMulticastBound.isMulticast()); | ||
}; | ||
|
||
TEST(IPv4AddressTest, MatchNetwork) | ||
{ | ||
FAIL() << "Not Implemented"; | ||
}; | ||
|
||
TEST(IPv6AddressTest, IPv6AddressStatics) | ||
{ | ||
IPv6Address const& ipZero = IPv6Address::Zero; | ||
EXPECT_EQ(ipZero.toString(), "::"); | ||
EXPECT_THAT(ipZero.toByteArray(), ::testing::Each(0)); | ||
|
||
IPv6Address const& ipMulticastLower = IPv6Address::MulticastRangeLowerBound; | ||
EXPECT_EQ(ipMulticastLower.toString(), "ff00::"); | ||
EXPECT_THAT(ipMulticastLower.toByteArray(), | ||
::testing::ElementsAre(0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
0x00, 0x00, 0x00)); | ||
}; | ||
|
||
TEST(IPv6AddressTest, IPv6AddressBasics) | ||
{ | ||
IPv6Address ipDefault; | ||
EXPECT_EQ(ipDefault.toString(), "::"); | ||
EXPECT_THAT(ipDefault.toByteArray(), ::testing::Each(0)); | ||
|
||
IPv6Address ipString("2001:0db8:85a3:0000:0000:8a4e:0370:7334"); | ||
EXPECT_EQ(ipString.toString(), "2001:db8:85a3::8a4e:370:7334"); | ||
EXPECT_THAT(ipString.toByteArray(), ::testing::ElementsAre(0x20, 0x01, 0x0D, 0xB8, 0x85, 0xA3, 0x00, 0x00, 0x00, | ||
0x00, 0x8A, 0x4E, 0x03, 0x70, 0x73, 0x34)); | ||
|
||
EXPECT_THROW(IPv6Address("2001:0db8:85a3:0000:0000:8a4e:0370:7334:extra"), std::invalid_argument) | ||
<< "IPv6Address does not throw for out of bounds IP string."; | ||
EXPECT_THROW(IPv6Address("2001::ab01::c"), std::invalid_argument) | ||
<< "IPv6Address does not throw for multiple double colon in IP string."; | ||
EXPECT_THROW(IPv6Address("bogusString"), std::invalid_argument) | ||
<< "IPv6Address does not throw for non-IP string."; | ||
|
||
std::array<uint8_t, 16> ipArrayBuffer = { 0x20, 0x01, 0x0D, 0xB8, 0x85, 0xA3, 0x00, 0x00, | ||
0x00, 0x00, 0x8A, 0x2E, 0x03, 0x70, 0x73, 0x34 }; | ||
|
||
IPv6Address ipUint8Raw(ipArrayBuffer.data()); | ||
EXPECT_EQ(ipUint8Raw.toString(), "2001:db8:85a3::8a2e:370:7334"); | ||
EXPECT_THAT(ipUint8Raw.toByteArray(), ::testing::ElementsAre(0x20, 0x01, 0x0D, 0xB8, 0x85, 0xA3, 0x00, 0x00, | ||
0x00, 0x00, 0x8A, 0x2E, 0x03, 0x70, 0x73, 0x34)); | ||
|
||
IPv6Address ipUint8Array(ipArrayBuffer); | ||
EXPECT_EQ(ipUint8Array.toString(), "2001:db8:85a3::8a2e:370:7334"); | ||
EXPECT_THAT(ipUint8Array.toByteArray(), ::testing::ElementsAre(0x20, 0x01, 0x0D, 0xB8, 0x85, 0xA3, 0x00, 0x00, | ||
0x00, 0x00, 0x8A, 0x2E, 0x03, 0x70, 0x73, 0x34)); | ||
|
||
EXPECT_TRUE(ipUint8Raw == ipUint8Array) << "Comparison operator '==' does not compare equal values correctly."; | ||
EXPECT_FALSE(ipUint8Raw == ipDefault) << "Comparison operator '==' does not compare unequal values correctly."; | ||
EXPECT_FALSE(ipUint8Raw != ipUint8Array) << "Comparison operator '!=' does not compare equal values correctly."; | ||
EXPECT_TRUE(ipUint8Raw != ipDefault) << "Comparison operator '!=' does not compare unequal values correctly."; | ||
|
||
EXPECT_TRUE(ipDefault < ipString) << "Comparison operator '<' does not compare less than values correctly."; | ||
EXPECT_FALSE(ipString < ipDefault) << "Comparison operator '<' does not compare less than values correctly."; | ||
|
||
std::array<uint8_t, 16> outBuffer = {}; | ||
ipUint8Array.copyTo(outBuffer.data()); | ||
EXPECT_EQ(ipUint8Array.toByteArray(), outBuffer); | ||
|
||
uint8_t* heapOutBuffer = nullptr; | ||
std::size_t heapOutBufferSize = 0; | ||
ipUint8Array.copyTo(&heapOutBuffer, heapOutBufferSize); | ||
|
||
ASSERT_NE(heapOutBuffer, nullptr); | ||
EXPECT_EQ(heapOutBufferSize, 16); | ||
EXPECT_TRUE(0 == std::memcmp(ipArrayBuffer.data(), heapOutBuffer, 16)); | ||
delete[] heapOutBuffer; | ||
}; | ||
|
||
TEST(IPv6AddressTest, Multicast) | ||
{ | ||
IPv6Address underMulticastBound("fef0::"); | ||
EXPECT_FALSE(underMulticastBound.isMulticast()); | ||
|
||
IPv6Address atLowerMulticastBound("ff00::"); | ||
EXPECT_TRUE(atLowerMulticastBound.isMulticast()); | ||
|
||
IPv6Address inMulticastRange("ff00::ef"); | ||
EXPECT_TRUE(inMulticastRange.isMulticast()); | ||
}; | ||
|
||
TEST(IPv6AddressTest, MatchNetwork) | ||
{ | ||
FAIL() << "Not Implemented"; | ||
}; | ||
|
||
TEST(IPAddressTest, IPAddressBasics) | ||
{ | ||
IPAddress ipDefault; | ||
EXPECT_EQ(ipDefault.getType(), IPAddress::AddressType::IPv4AddressType); | ||
EXPECT_EQ(ipDefault.getIPv4(), IPv4Address::Zero); | ||
EXPECT_TRUE(ipDefault.isZero()); | ||
EXPECT_EQ(ipDefault.toString(), "0.0.0.0"); | ||
|
||
IPAddress ip4String("192.168.0.1"); | ||
EXPECT_EQ(ip4String.getType(), IPAddress::AddressType::IPv4AddressType); | ||
EXPECT_EQ(ip4String.getIPv4(), IPv4Address("192.168.0.1")); | ||
EXPECT_FALSE(ip4String.isZero()); | ||
EXPECT_EQ(ip4String.toString(), "192.168.0.1"); | ||
|
||
IPAddress ip6ZeroString("::"); | ||
EXPECT_EQ(ip6ZeroString.getType(), IPAddress::AddressType::IPv6AddressType); | ||
EXPECT_EQ(ip6ZeroString.getIPv6(), IPv6Address::Zero); | ||
EXPECT_TRUE(ip6ZeroString.isZero()); | ||
EXPECT_EQ(ip6ZeroString.toString(), "::"); | ||
|
||
IPAddress ip6String("2001:db8:85a3::8a2e:370:7334"); | ||
EXPECT_EQ(ip6String.getType(), IPAddress::AddressType::IPv6AddressType); | ||
EXPECT_EQ(ip6String.getIPv6(), IPv6Address("2001:db8:85a3::8a2e:370:7334")); | ||
EXPECT_FALSE(ip6String.isZero()); | ||
EXPECT_EQ(ip6String.toString(), "2001:db8:85a3::8a2e:370:7334"); | ||
|
||
EXPECT_THROW(IPAddress("192.168.300.1"), std::invalid_argument); | ||
EXPECT_THROW(IPAddress("2001:db8:85a3::8a2e:370:7334:extra"), std::invalid_argument) | ||
<< "IPAddress does not throw for out of bounds IP string."; | ||
EXPECT_THROW(IPv6Address("2001::ab01::c"), std::invalid_argument) | ||
<< "IPAddress does not throw for multiple double colon in IP string."; | ||
EXPECT_THROW(IPAddress("bogusString"), std::invalid_argument) << "IPAddress does not throw for non-IP string."; | ||
|
||
EXPECT_TRUE(ipDefault == IPv4Address::Zero) << "Comparison operator '==' does not compare equal values correctly."; | ||
EXPECT_FALSE(ipDefault != IPv4Address::Zero) << "Comparison operator '!=' does not compare equal values correctly."; | ||
|
||
EXPECT_FALSE(ipDefault == ip6ZeroString) << "Comparison operator '==' between IPv4 and IPv6 should always return false"; | ||
EXPECT_TRUE(ipDefault != ip6ZeroString) << "Comparison operator '!=' between IPv4 and IPv6 should always return true"; | ||
|
||
// Todo: less than operator | ||
}; | ||
|
||
TEST(IPAddressTest, Multicast) | ||
{ | ||
FAIL() << "Not Implemented"; | ||
}; | ||
|
||
TEST(IPv4NetworkTest, IPv4NetworkTest) | ||
{ | ||
FAIL() << "Not Implemented"; | ||
}; | ||
|
||
TEST(IPv6NetworkTest, IPv6NetworkTest) | ||
{ | ||
FAIL() << "Not Implemented"; | ||
}; | ||
|
||
TEST(IPNetworkTest, IPNetworkTest) | ||
{ | ||
FAIL() << "Not Implemented"; | ||
}; | ||
} // namespace pcpp |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.