#include <fmt/format.h>

#include <stdplus/net/addr/ether.hpp>

#include <gtest/gtest.h>

namespace stdplus
{

TEST(EqualOperator, EtherAddr)
{
    EXPECT_EQ((EtherAddr{1}), (ether_addr{1}));
    EXPECT_EQ((EtherAddr{}), (EtherAddr{}));
    EXPECT_NE((EtherAddr{1}), (EtherAddr{ether_addr{}}));
    std::hash<EtherAddr>{}(EtherAddr{});
}

TEST(Query, IsEmpty)
{
    EXPECT_TRUE((EtherAddr{}.isEmpty()));
    EXPECT_FALSE((EtherAddr{1}.isEmpty()));
    EXPECT_FALSE((EtherAddr{0, 0, 0, 1}.isEmpty()));
}

TEST(Query, IsMulticast)
{
    EXPECT_TRUE((EtherAddr{255, 255, 255, 255, 255, 255}.isMulticast()));
    EXPECT_TRUE((EtherAddr{1}.isMulticast()));
    EXPECT_FALSE((EtherAddr{0, 1, 2, 3, 4, 5}.isMulticast()));
    EXPECT_FALSE((EtherAddr{0xfe, 255, 255, 255, 255, 255}.isMulticast()));
}

TEST(Query, IsUnicast)
{
    EXPECT_TRUE((EtherAddr{0, 1, 2, 3, 4, 5}.isUnicast()));
    EXPECT_TRUE((EtherAddr{0xfe, 255, 255, 255, 255, 255}.isUnicast()));
    EXPECT_FALSE((EtherAddr{}.isUnicast()));
    EXPECT_FALSE((EtherAddr{1}.isUnicast()));
    EXPECT_FALSE((EtherAddr{255, 255, 255, 255, 255, 255}.isUnicast()));
}

TEST(ToStr, EthAddr)
{
    ToStrHandle<ToStr<EtherAddr>> tsh;
    EXPECT_EQ("11:22:33:44:55:66",
              tsh(EtherAddr{0x11, 0x22, 0x33, 0x44, 0x55, 0x66}));
    EXPECT_EQ("01:02:03:04:05:67",
              tsh(EtherAddr{0x01, 0x02, 0x03, 0x04, 0x05, 0x67}));
    EXPECT_EQ("00:00:00:00:00:00",
              tsh(ether_addr{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}));
    EXPECT_EQ(
        "a 01:02:03:04:05:67 b",
        fmt::format("a {} b", EtherAddr{0x01, 0x02, 0x03, 0x04, 0x05, 0x67}));
}

TEST(FromStr, EtherAddr)
{
    EXPECT_THROW(fromStr<EtherAddr>("0x:00:00:00:00:00"),
                 std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("00:00:00:00:00"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("00:00:00:00:00:"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("00:00:00:00::00"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>(":00:00:00:00:00"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("00::00:00:00:00"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>(":::::"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("00:0:0:0:0"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("00:00:00:00:00:00:00"),
                 std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>(""), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("123456789XYZ"), std::invalid_argument);
    EXPECT_THROW(fromStr<EtherAddr>("123456789AB"), std::overflow_error);
    EXPECT_THROW(fromStr<EtherAddr>("123456789ABCD"), std::overflow_error);

    EXPECT_EQ((EtherAddr{}), fromStr<EtherAddr>("00:00:00:00:00:00"));
    EXPECT_EQ((EtherAddr{0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa}),
              fromStr<EtherAddr>("FF:EE:DD:cc:bb:aa"));
    EXPECT_EQ((EtherAddr{0x00, 0x01, 0x02, 0x03, 0x04, 0x05}),
              fromStr<EtherAddr>("0:1:2:3:4:5"));
    EXPECT_EQ((EtherAddr{0x01, 0x23, 0x45, 0x67, 0x89, 0xab}),
              fromStr<EtherAddr>("0123456789AB"));
    EXPECT_EQ((EtherAddr{0xff, 0xee, 0xdd, 0xcc, 0xbb, 0xaa}),
              fromStr<EtherAddr>("FFEEDDccbbaa"));
}

} // namespace stdplus
