[ox/mc] Fix serialization of negative numbers in non-64 bit values

This commit is contained in:
2023-12-22 19:36:42 -06:00
parent c460e0f9e0
commit 9db10ec4a1
2 changed files with 7 additions and 3 deletions

View File

@ -267,6 +267,9 @@ std::map<ox::StringView, ox::Error(*)()> tests = {
return OxError(0);
};
oxAssert(check(uint32_t(14)), "Decode of 14 failed.");
oxAssert(check(int8_t(-1)), "Decode of -1 failed.");
oxAssert(check(int16_t(-1)), "Decode of -1 failed.");
oxAssert(check(int32_t(-1)), "Decode of -1 failed.");
oxAssert(check(int64_t(-1)), "Decode of -1 failed.");
oxAssert(check(int64_t(-2)), "Decode of -2 failed.");
oxAssert(check(int64_t(-127)), "Decode of -127 failed.");