diff --git a/test/bitwise/not.cpp b/test/bitwise/not.cpp index d040e8c..c91576d 100755 --- a/test/bitwise/not.cpp +++ b/test/bitwise/not.cpp @@ -1,5 +1,4 @@ #include -#include #include "../../Aeu.h" #include "../../Aesi.h" #include "../generation.h" @@ -12,7 +11,10 @@ TEST(Unsigned_Bitwise, NOT) { value <<= (blocksNumber * 32 - value.BitCount()); std::stringstream ss {}; - ss << std::format("0b{:b}", static_cast(~value.GetByte(value.ByteCount() - 1))); + std::string binary {}; + for (auto byte = static_cast(~value.GetByte(value.ByteCount() - 1)); byte; byte >>= 1) + binary += (byte & 1 ? '1' : '0'); + ss << "0b" << std::string(binary.rbegin(), binary.rend()); for(long long j = value.ByteCount() - 2; j >= 0; --j) ss << std::bitset<8>(~value.GetByte(j)); diff --git a/test/operations/initialization/signed.cpp b/test/operations/initialization/signed.cpp index 7772f37..34fbf82 100755 --- a/test/operations/initialization/signed.cpp +++ b/test/operations/initialization/signed.cpp @@ -1,6 +1,5 @@ #include #include -#include #include "../../../Aesi.h" #include "../../generation.h" @@ -136,8 +135,11 @@ TEST(Signed_Initialization, Binary) { const auto value = (i % 2 == 0 ? 1 : -1) * Generation::getRandomWithBits(blocksNumber * 32 - 20); record = value; EXPECT_EQ(record, value); + std::string binary {}; + for (auto byte = value.GetByte(value.ByteCount() - 1); byte; byte >>= 1) + binary += (byte & 1 ? '1' : '0'); std::stringstream ss {}; - ss << (i % 2 == 0 ? "" : "-") << "0b" << std::format("{:b}", value.GetByte(value.ByteCount() - 1)); + ss << (i % 2 == 0 ? "" : "-") << "0b" << std::string(binary.rbegin(), binary.rend()); for(long long j = value.ByteCount() - 2; j >= 0; --j) ss << std::bitset<8>(value.GetByte(j)); record = ss.str(); EXPECT_EQ(record, value); diff --git a/test/operations/initialization/unsigned.cpp b/test/operations/initialization/unsigned.cpp index c11ede8..077e016 100755 --- a/test/operations/initialization/unsigned.cpp +++ b/test/operations/initialization/unsigned.cpp @@ -1,6 +1,5 @@ #include #include -#include #include "../../../Aeu.h" #include "../../generation.h" @@ -86,7 +85,10 @@ TEST(Unsigned_Initialization, Binary) { record = value; EXPECT_EQ(record, value); std::stringstream ss {}; - ss << "0b" << std::format("{:b}", value.GetByte(value.ByteCount() - 1)); + std::string binary {}; + for (auto byte = value.GetByte(value.ByteCount() - 1); byte; byte >>= 1) + binary += (byte & 1 ? '1' : '0'); + ss << "0b" << std::string(binary.rbegin(), binary.rend()); for(long long j = value.ByteCount() - 2; j >= 0; --j) ss << std::bitset<8>(value.GetByte(j)); record = ss.str(); EXPECT_EQ(record, value);