This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/tests/sensors/TestMAC.cpp
FrankE f8d7f768f1 added missing code changes
started working on refactoring of sensors
new test-cases
2016-03-17 17:28:41 +01:00

33 lines
559 B
C++

#ifdef WITH_TESTS
#include "../Tests.h"
#include "../../sensors/MACAddress.h"
TEST(MAC, ctorSize) {
ASSERT_THROW(MACAddress("12:34:56:78:9A:A"), std::exception);
MACAddress("12:34:56:78:9A:AB");
ASSERT_THROW(MACAddress("12:34:56:78:9A:ABC"), std::exception);
}
TEST(MAC, caseInsensitive) {
MACAddress mac1("12:34:56:78:9A:BC");
MACAddress mac2("12:34:56:78:9a:bc");
ASSERT_EQ(mac1, mac2);
}
TEST(MAC, convertLong) {
MACAddress mac1("12:34:56:78:9A:BC");
MACAddress mac2 = MACAddress( mac1.asLong() );
ASSERT_EQ(mac1, mac2);
}
#endif