summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-14 21:16:48 +0200
committerSven Gothel <[email protected]>2020-09-14 21:16:48 +0200
commitbe1586b6bacd09097038cbf4b6aa0f9098b9dca4 (patch)
treecb66351a875a2e0f3d18f09d59add0c98df97c97 /test
parentc10af68a6d94fd901a938b60c843c6ee0ba8af84 (diff)
C++ noexcept: uuid_t and its implementations; Make uuid_t::TypeSize and 'enum class' type
In case of an internal error, simply ERR_PRINT and abort, usually the toString() implementations.
Diffstat (limited to 'test')
-rw-r--r--test/direct_bt/test_attpdu01.cpp4
-rw-r--r--test/direct_bt/test_uuid.cpp20
2 files changed, 12 insertions, 12 deletions
diff --git a/test/direct_bt/test_attpdu01.cpp b/test/direct_bt/test_attpdu01.cpp
index aac1df89..68abcd4c 100644
--- a/test/direct_bt/test_attpdu01.cpp
+++ b/test/direct_bt/test_attpdu01.cpp
@@ -21,8 +21,8 @@ class Cppunit_tests: public Cppunit {
const AttReadByNTypeReq req(true /* group */, 1, 0xffff, uuid16);
std::shared_ptr<const uuid_t> uuid16_2 = req.getNType();
- CHECK(uuid16.getTypeSize(), 2);
- CHECK(uuid16_2->getTypeSize(), 2);
+ CHECK(uuid16.getTypeSizeInt(), 2);
+ CHECK(uuid16_2->getTypeSizeInt(), 2);
CHECKT( 0 == memcmp(uuid16.data(), uuid16_2->data(), 2) )
CHECKT( uuid16.toString() == uuid16_2->toString() );
diff --git a/test/direct_bt/test_uuid.cpp b/test/direct_bt/test_uuid.cpp
index 9b1230a9..dd933a0f 100644
--- a/test/direct_bt/test_uuid.cpp
+++ b/test/direct_bt/test_uuid.cpp
@@ -23,40 +23,40 @@ class Cppunit_tests : public Cppunit {
{
const uuid128_t v01 = uuid128_t(uuid128_bytes, 0, true);
- CHECK(v01.getTypeSize(), 16);
- CHECK(v01.getTypeSize(), sizeof(v01.value));
- CHECK(v01.getTypeSize(), sizeof(v01.value.data));
+ CHECK(v01.getTypeSizeInt(), 16);
+ CHECK(v01.getTypeSizeInt(), sizeof(v01.value));
+ CHECK(v01.getTypeSizeInt(), sizeof(v01.value.data));
CHECKT( 0 == memcmp(uuid128_bytes, v01.data(), 16) )
put_uuid(buffer, 0, v01, true);
std::shared_ptr<const uuid_t> v02 = uuid_t::create(uuid_t::TypeSize::UUID128_SZ, buffer, 0, true);
- CHECK(v02->getTypeSize(), 16);
+ CHECK(v02->getTypeSizeInt(), 16);
CHECKT( 0 == memcmp(v01.data(), v02->data(), 16) )
CHECKT( v01.toString() == v02->toString() );
}
{
const uuid32_t v01 = uuid32_t(uuid32_t(0x12345678));
- CHECK(v01.getTypeSize(), 4);
- CHECK(v01.getTypeSize(), sizeof(v01.value));
+ CHECK(v01.getTypeSizeInt(), 4);
+ CHECK(v01.getTypeSizeInt(), sizeof(v01.value));
CHECK(0x12345678, v01.value);
put_uuid(buffer, 0, v01, true);
std::shared_ptr<const uuid_t> v02 = uuid_t::create(uuid_t::TypeSize::UUID32_SZ, buffer, 0, true);
- CHECK(v02->getTypeSize(), 4);
+ CHECK(v02->getTypeSizeInt(), 4);
CHECKT( 0 == memcmp(v01.data(), v02->data(), 4) )
CHECKT( v01.toString() == v02->toString() );
}
{
const uuid16_t v01 = uuid16_t(uuid16_t(0x1234));
- CHECK(v01.getTypeSize(), 2);
- CHECK(v01.getTypeSize(), sizeof(v01.value));
+ CHECK(v01.getTypeSizeInt(), 2);
+ CHECK(v01.getTypeSizeInt(), sizeof(v01.value));
CHECK(0x1234, v01.value);
put_uuid(buffer, 0, v01, true);
std::shared_ptr<const uuid_t> v02 = uuid_t::create(uuid_t::TypeSize::UUID16_SZ, buffer, 0, true);
- CHECK(v02->getTypeSize(), 2);
+ CHECK(v02->getTypeSizeInt(), 2);
CHECKT( 0 == memcmp(v01.data(), v02->data(), 2) )
CHECKT( v01.toString() == v02->toString() );
}