diff --git a/test/test_alignment.cpp b/test/test_alignment.cpp index 4f55c829..ba0b25ab 100644 --- a/test/test_alignment.cpp +++ b/test/test_alignment.cpp @@ -67,6 +67,35 @@ namespace f(static_cast(data9)); } + //************************************************************************* + TEST(test_aligned_storage_conversion_operators) + { + typedef etl::aligned_storage::value>::type storage32_t; + static storage32_t data; + + void* pdata = &data.data; + + uint32_t& ref = data; + const uint32_t& cref = data; + CHECK(&ref == pdata); + CHECK(&cref == pdata); + + uint32_t* ptr = data; + const uint32_t* cptr = data; + CHECK(ptr == pdata); + CHECK(cptr == pdata); + + uint32_t& ref2 = data.get_reference(); + const uint32_t& cref2 = data.get_reference(); + CHECK(&ref2 == pdata); + CHECK(&cref2 == pdata); + + uint32_t* ptr2 = data.get_address(); + const uint32_t* cptr2 = data.get_address(); + CHECK(ptr2 == pdata); + CHECK(cptr2 == pdata); + } + //************************************************************************* TEST(test_aligned_storage_as) {