mirror of
https://github.com/mfontanini/libtins
synced 2026-01-28 20:44:26 +01:00
Fixed some bugs, added some tests.
This commit is contained in:
18
tests/src/ipaddress.cpp
Normal file
18
tests/src/ipaddress.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include "ipaddress.h"
|
||||
#include "utils.h"
|
||||
|
||||
using namespace Tins;
|
||||
|
||||
std::string ip_string("192.168.0.225");
|
||||
|
||||
TEST(IPAddressTest, Constructor) {
|
||||
IPv4Address addr1(ip_string);
|
||||
IPv4Address addr2(Utils::ip_to_int(ip_string));
|
||||
EXPECT_EQ(addr2, addr1);
|
||||
EXPECT_EQ((std::string)addr1, ip_string);
|
||||
EXPECT_EQ((std::string)addr2, ip_string);
|
||||
}
|
||||
Reference in New Issue
Block a user