diff options
author | Sven Gothel <[email protected]> | 2020-09-14 21:16:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-09-14 21:16:48 +0200 |
commit | ef8b80336f394b199b619741b146e54eba95bdd0 (patch) | |
tree | adb4dc031dea5bd081c4c5de6dcd522b536f329a /test | |
parent | fc5c012f6e2895c880ebbcaedb73f90b707fd5d6 (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_uuid.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/direct_bt/test_uuid.cpp b/test/direct_bt/test_uuid.cpp index 9b1230a..dd933a0 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() ); } |