diff --git a/test/test_manchester.cpp b/test/test_manchester.cpp index 68a9deaa..bd357435 100644 --- a/test/test_manchester.cpp +++ b/test/test_manchester.cpp @@ -6,8 +6,6 @@ #include #include -#if ETL_USING_CPP11 - SUITE(test_manchester) { TEST(encode_uint8_t) @@ -17,9 +15,9 @@ SUITE(test_manchester) CHECK_EQUAL(0xAAA9, (etl::manchester::encode(0x01U))); CHECK_EQUAL(0x6AAA, (etl::manchester::encode(0x80U))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0xAAAA == etl::manchester::encode(0x00U), "Compile time manchester encoding failed"); - #endif +#endif } TEST(encode_uint8_t_inverted) @@ -29,9 +27,9 @@ SUITE(test_manchester) CHECK_EQUAL(0x5556, (etl::manchester_inverted::encode(0x01U))); CHECK_EQUAL(0x9555, (etl::manchester_inverted::encode(0x80U))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x5555 == etl::manchester_inverted::encode(0x00U), "Compile time manchester encoding failed"); - #endif +#endif } TEST(encode_uint16_t) @@ -39,9 +37,9 @@ SUITE(test_manchester) CHECK_EQUAL(0x5555AAAA, (etl::manchester::encode(0xFF00UL))); CHECK_EQUAL(0x6AAAAAA9, (etl::manchester::encode(0x8001UL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x5555AAAA == etl::manchester::encode(0xFF00UL), "Compile time manchester encoding failed"); - #endif +#endif } TEST(encode_uint16_t_inverted) @@ -49,30 +47,30 @@ SUITE(test_manchester) CHECK_EQUAL(0xAAAA5555, (etl::manchester_inverted::encode(0xFF00UL))); CHECK_EQUAL(0x95555556, (etl::manchester_inverted::encode(0x8001UL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0xAAAA5555 == etl::manchester_inverted::encode(0xFF00UL), "Compile time manchester encoding failed"); - #endif +#endif } TEST(encode_uint32_t) { CHECK_EQUAL(0x6AAAAAA95555AAAA, (etl::manchester::encode(0x8001FF00ULL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x6AAAAAA95555AAAA == etl::manchester::encode(0x8001FF00ULL), "Compile time manchester encoding failed"); - #endif +#endif } TEST(encode_uint32_t_inverted) { CHECK_EQUAL(0x95555556AAAA5555, (etl::manchester_inverted::encode(0x8001FF00ULL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x95555556AAAA5555 == etl::manchester_inverted::encode(0x8001FF00ULL), "Compile time manchester encoding failed"); - #endif +#endif } - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 constexpr etl::array manchester_encoded_uint8(etl::span decoded) { etl::array encoded{0, 0, 0, 0, 0, 0, 0, 0}; @@ -93,7 +91,7 @@ SUITE(test_manchester) etl::manchester::encode(decoded, encoded); return encoded; } - #endif +#endif TEST(encode_span) { @@ -123,7 +121,7 @@ SUITE(test_manchester) CHECK_TRUE(encoded0 == encoded3); } - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 TEST(encode_span_constexpr) { constexpr etl::array decoded{0x00, 0xFF, 0x01, 0x80}; @@ -155,7 +153,7 @@ SUITE(test_manchester) static_assert(manchester_encoded_uint32(decoded)[6] == 0xAA, "Compile time encoding with uint32_t failed"); static_assert(manchester_encoded_uint32(decoded)[7] == 0x6A, "Compile time encoding with uint32_t failed"); } - #endif +#endif TEST(encode_span_inverted) { @@ -216,9 +214,9 @@ SUITE(test_manchester) CHECK_EQUAL(0x01, (etl::manchester::decode(0xAAA9UL))); CHECK_EQUAL(0x80, (etl::manchester::decode(0x6AAAUL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x00 == etl::manchester::decode(0xAAAAUL), "Compile time manchester decoding failed"); - #endif +#endif } TEST(decode_uint16_t_inverted) @@ -228,9 +226,9 @@ SUITE(test_manchester) CHECK_EQUAL(0x01, (etl::manchester_inverted::decode(0x5556UL))); CHECK_EQUAL(0x80, (etl::manchester_inverted::decode(0x9555UL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x00 == etl::manchester_inverted::decode(0x5555UL), "Compile time manchester decoding failed"); - #endif +#endif } TEST(decode_uint32_t) @@ -238,9 +236,9 @@ SUITE(test_manchester) CHECK_EQUAL(0xFF00UL, (etl::manchester::decode(0x5555AAAAUL))); CHECK_EQUAL(0x8001UL, (etl::manchester::decode(0x6AAAAAA9UL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0xFF00UL == etl::manchester::decode(0x5555AAAAUL), "Compile time manchester decoding failed"); - #endif +#endif } TEST(decode_uint32_t_inverted) @@ -248,30 +246,30 @@ SUITE(test_manchester) CHECK_EQUAL(0xFF00UL, (etl::manchester_inverted::decode(0xAAAA5555UL))); CHECK_EQUAL(0x8001UL, (etl::manchester_inverted::decode(0x95555556UL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0xFF00UL == etl::manchester_inverted::decode(0xAAAA5555UL), "Compile time manchester decoding failed"); - #endif +#endif } TEST(decode_uint64_t) { CHECK_EQUAL(0x8001FF00ULL, (etl::manchester::decode(0x6AAAAAA95555AAAAULL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x8001FF00ULL == etl::manchester::decode(0x6AAAAAA95555AAAAULL), "Compile time manchester decoding failed"); - #endif +#endif } TEST(decode_uint64_t_inverted) { CHECK_EQUAL(0x8001FF00ULL, (etl::manchester_inverted::decode(0x95555556AAAA5555ULL))); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(0x8001FF00ULL == etl::manchester_inverted::decode(0x95555556AAAA5555ULL), "Compile time manchester decoding failed"); - #endif +#endif } - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 constexpr etl::array manchester_decoded_uint16(etl::span encoded) { etl::array decoded{0, 0, 0, 0}; @@ -292,7 +290,7 @@ SUITE(test_manchester) etl::manchester::decode(encoded, decoded); return decoded; } - #endif +#endif TEST(decode_span) { @@ -318,7 +316,7 @@ SUITE(test_manchester) CHECK_TRUE(decoded0 == decoded3); } - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 TEST(decode_span_constexpr) { constexpr etl::array encoded{0xAA, 0xAA, 0x55, 0x55, 0xA9, 0xAA, 0xAA, 0x6A}; @@ -338,7 +336,7 @@ SUITE(test_manchester) static_assert(manchester_decoded_uint64(encoded)[2] == 0x01, "Compile time decoding with uint64_t failed"); static_assert(manchester_decoded_uint64(encoded)[3] == 0x80, "Compile time decoding with uint64_t failed"); } - #endif +#endif TEST(decode_span_inverted) { @@ -397,10 +395,10 @@ SUITE(test_manchester) CHECK_FALSE(etl::manchester::is_valid(0xAAA8UL)); CHECK_FALSE(etl::manchester_inverted::is_valid(0xAAA8UL)); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(etl::manchester::is_valid(0xAAAAUL), "Compile time manchester validity check failed"); static_assert(etl::manchester_inverted::is_valid(0xAAAAUL), "Compile time manchester validity check failed"); - #endif +#endif } TEST(valid32) @@ -410,10 +408,10 @@ SUITE(test_manchester) CHECK_FALSE(etl::manchester::is_valid(0xAAAAAAA8UL)); CHECK_FALSE(etl::manchester_inverted::is_valid(0xAAAAAAA8UL)); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(etl::manchester::is_valid(0xAAAAAAAAUL), "Compile time manchester validity check failed"); static_assert(etl::manchester_inverted::is_valid(0xAAAAAAAAUL), "Compile time manchester validity check failed"); - #endif +#endif } TEST(valid64) @@ -423,10 +421,10 @@ SUITE(test_manchester) CHECK_FALSE(etl::manchester::is_valid(0xAAAAAAAAAAAAAAA8ULL)); CHECK_FALSE(etl::manchester_inverted::is_valid(0xAAAAAAAAAAAAAAA8ULL)); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(etl::manchester::is_valid(0xAAAAAAAAAAAAAAAAULL), "Compile time manchester validity check failed"); static_assert(etl::manchester_inverted::is_valid(0xAAAAAAAAAAAAAAAAULL), "Compile time manchester validity check failed"); - #endif +#endif } TEST(valid_span) @@ -437,10 +435,10 @@ SUITE(test_manchester) CHECK_TRUE(etl::manchester::is_valid(encoded1)); CHECK_FALSE(etl::manchester::is_valid(encoded2)); - #if ETL_USING_CPP14 +#if ETL_USING_CPP14 static_assert(etl::manchester::is_valid(encoded1), "Compile time manchester validity check failed"); static_assert(!etl::manchester::is_valid(encoded2), "Compile time manchester validity check failed"); - #endif +#endif } TEST(valid_span_on_invalid_source) @@ -449,5 +447,3 @@ SUITE(test_manchester) CHECK_THROW({ std::ignore = etl::manchester::is_valid(invalid_source); }, etl::manchester_invalid_size); } } - -#endif diff --git a/test/test_rounded_integral_division.cpp b/test/test_rounded_integral_division.cpp index 7250155e..a29d2506 100644 --- a/test/test_rounded_integral_division.cpp +++ b/test/test_rounded_integral_division.cpp @@ -34,8 +34,6 @@ SOFTWARE. #include #include -#if ETL_USING_CPP11 - namespace { SUITE(test_constant) @@ -912,5 +910,3 @@ namespace } } } // namespace - -#endif