1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-24 19:21:35 +01:00

Add missing operators to address classes (#275)

* * add or-operator and a simlple unit test for hw_address, ip_address, ipv6_address
* add not-operator and a simlple unit test for hw_address, ip_address, ipv6_address
* add greater-then-operator and a simlple unit test for ipv6_address
* add new constructor and a simlple unit test for network_interface, which use a ipv6_address to find the nic
* add override the function gateway_from_ip for ipv6_address parameter (untested)

* change the ipv6_address in NotMaskAdress_Test, so that the expceted addresses are valid for the winsock api

* Delete CMakeLists.txt.user

* * add  <=, >, >= operator for HWAddress with tests

* add  <=, >, >= operator for IPv4Address with tests
* add  <=,>= operator for IPv6Address with tests

* refactoring the  & , |, ~ operator of ipv6_address to "regular" operator
This commit is contained in:
stubbfel
2018-03-29 05:44:28 +02:00
committed by Matias Fontanini
parent 7848e28b62
commit 342e2c77a7
14 changed files with 371 additions and 7 deletions

View File

@@ -37,6 +37,8 @@ TEST_F(NetworkInterfaceTest, ConstructorFromString) {
TEST_F(NetworkInterfaceTest, ConstructorFromIp) {
NetworkInterface iface(IPv4Address("127.0.0.1"));
EXPECT_EQ(iface.name(), iface_name);
NetworkInterface i6face(IPv6Address("::1"));
EXPECT_EQ(i6face.name(), iface_name);
}
TEST_F(NetworkInterfaceTest, Id) {