diff --git a/tests/byte_tests.cpp b/tests/byte_tests.cpp index 634dcc9..1d2052a 100644 --- a/tests/byte_tests.cpp +++ b/tests/byte_tests.cpp @@ -16,6 +16,7 @@ #include +#define GSL_USE_STD_BYTE 0 #include // for to_byte, to_integer, byte, operator&, ope... using namespace std; @@ -33,28 +34,28 @@ int modify_both(gsl::byte& b, int& i) TEST(byte_tests, construction) { { - const byte b = static_cast(4); + const gsl::byte b = static_cast(4); EXPECT_TRUE(static_cast(b) == 4); } { - const byte b = byte(12); + const gsl::byte b = gsl::byte(12); EXPECT_TRUE(static_cast(b) == 12); } { - const byte b = to_byte<12>(); + const gsl::byte b = to_byte<12>(); EXPECT_TRUE(static_cast(b) == 12); } { const unsigned char uc = 12; - const byte b = to_byte(uc); + const gsl::byte b = to_byte(uc); EXPECT_TRUE(static_cast(b) == 12); } #if defined(__cplusplus) && (__cplusplus >= 201703L) { - const byte b{14}; + const gsl::byte b{14}; EXPECT_TRUE(static_cast(b) == 14); } #endif @@ -68,9 +69,9 @@ TEST(byte_tests, construction) TEST(byte_tests, bitwise_operations) { - const byte b = to_byte<0xFF>(); + const gsl::byte b = to_byte<0xFF>(); - byte a = to_byte<0x00>(); + gsl::byte a = to_byte<0x00>(); EXPECT_TRUE((b | a) == to_byte<0xFF>()); EXPECT_TRUE(a == to_byte<0x00>()); @@ -104,7 +105,7 @@ TEST(byte_tests, bitwise_operations) TEST(byte_tests, to_integer) { - const byte b = to_byte<0x12>(); + const gsl::byte b = to_byte<0x12>(); EXPECT_TRUE(0x12 == gsl::to_integer(b)); EXPECT_TRUE(0x12 == gsl::to_integer(b)); @@ -123,7 +124,7 @@ TEST(byte_tests, to_integer) TEST(byte_tests, aliasing) { int i{0}; - const int res = modify_both(reinterpret_cast(i), i); + const int res = modify_both(reinterpret_cast(i), i); EXPECT_TRUE(res == i); }