added missing code changes

started working on refactoring of sensors
new test-cases
This commit is contained in:
2016-03-17 17:28:41 +01:00
parent 6346231a64
commit f8d7f768f1
18 changed files with 524 additions and 74 deletions

32
tests/sensors/TestMAC.cpp Normal file
View File

@@ -0,0 +1,32 @@
#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