pattern: std::from_chars is not widely supported and doesn't support u128...

This commit is contained in:
WerWolv
2022-02-02 17:12:19 +01:00
parent 4c51efc5e0
commit c2bcbfb1e0
3 changed files with 37 additions and 33 deletions

View File

@@ -9,10 +9,10 @@ namespace hex::test {
TestPatternEnums() : TestPattern("Enums") {
auto testEnum = create<PatternDataEnum>("TestEnum", "testEnum", 0x08, sizeof(u32));
testEnum->setEnumValues({
{u128(0x0000), "A"},
{ i128(0x0C), "B"},
{ u128(0x0D), "C"},
{ u128(0x0E), "D"},
{u128(0x00), "A"},
{ i128(0x0C), "B"},
{ u128(0x0D), "C"},
{ u128(0x0E), "D"},
});
testEnum->setEndian(std::endian::big);

View File

@@ -31,7 +31,7 @@ namespace hex::test {
std::assert(0xFF00FF | 0x00AA00 == 0xFFAAFF, "| operator error");
std::assert(0xFFFFFF & 0x00FF00 == 0x00FF00, "& operator error");
std::assert(0xFFFFFF ^ 0x00AA00 == 0xFF55FF, "^ operator error");
std::assert(~0x00 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, "~ operator error");
std::assert(~0x00U == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, "~ operator error");
std::assert(0xAA >> 4 == 0x0A, ">> operator error");
std::assert(0xAA << 4 == 0xAA0, "<< operator error");