123456789101112131415161718192021 |
- #include <unity.h>
- #include "kbf/net.h"
- using namespace kbf;
- TEST_CASE("MAC address functions", "[kbf_net]") {
- uint8_t addr[] = {0, 0, 11, 128, 176, 255};
- auto mac = net::MAC(addr);
- TEST_ASSERT_EQUAL_STRING_MESSAGE("00:00:0B:80:B0:FF", mac.str().c_str(), "ctor / str()");
- net::setMac(mac);
- TEST_ASSERT_EQUAL_STRING_MESSAGE(mac.str().c_str(), net::getMac().str().c_str(), "getMac");
- }
- TEST_CASE("IP address functions", "[kbf_net]") {
- auto ip = net::IP({2952898752});
- TEST_ASSERT_EQUAL_STRING_MESSAGE("192.168.1.176", ip.str().c_str(), "str()");
- }
|