#include <fmt/format.h>

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

#include <format>

#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, 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}));
    EXPECT_EQ("a 01:02:03:04:05:67 b",
              std::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
