Commit b1d85e3b authored by Lev Walkin's avatar Lev Walkin
Browse files

more tests for integer decoding on ilp32

parent 73823e1f
......@@ -166,35 +166,40 @@ main() {
CHECK(0, 1073741803UL, -10, 1073741803UL, 30);
CHECK(0, 2147483607UL, -10, 2147483607UL, 31);
if(sizeof(long) == 4) {
CHECK(0, 0, 0, 4294967205UL, 32);
CHECK(0, 1, 0, 4294967205UL, 32);
CHECK(0, 10, 0, 4294967205UL, 32);
CHECK(0, 0x8babab, 0, 4294967205UL, 32);
CHECK(1, 0x8babab, 0, 4294967295UL, 32);
CHECK(1, 0x8babab, 10, 4294967205UL, 32);
CHECK(1, 11, 10, 4294967205UL, 32);
CHECK(1, 10, 10, 4294967205UL, 32);
CHECK(0, -2147483648, -2147483648, 2147483647, 32);
CHECK(0, -10, -2147483648, 2147483647, 32);
CHECK(0, -1, -2147483648, 2147483647, 32);
CHECK(0, 0, -2147483648, 2147483647, 32);
CHECK(0, 1, -2147483648, 2147483647, 32);
CHECK(0, 10, -2147483648, 2147483647, 32);
CHECK(0, 2147483647, -2147483648, 2147483647, 32);
CHECK(1, 0, 0, 4294967295UL, 32);
CHECK(1, 1, 0, 4294967295UL, 32);
CHECK(1, 10, 0, 4294967295UL, 32);
CHECK(1, 2000000000, 0, 4294967295UL, 32);
CHECK(1, 2147483647, 0, 4294967295UL, 32);
CHECK(1, 2147483648, 0, 4294967295UL, 32);
CHECK(1, 4000000000, 0, 4294967295UL, 32);
} else {
CHECK(0, 0, -10, 4294967205UL, 32);
CHECK(0, 1, -10, 4294967205UL, 32);
CHECK(0, -1, -10, 4294967205UL, 32);
CHECK(0, -10, -10, 4294967205UL, 32);
CHECK(0, -10, -10, 4294967205UL, 32);
CHECK(0, 0x8babab, -10, 4294967205UL, 32);
CHECK(1, 4294967295UL, 0, 4294967295UL, 32);
CHECK(1, 10, 10, 4294967285UL, 32);
CHECK(1, 11, 10, 4294967285UL, 32);
if(sizeof(long) > sizeof(uint32_t)) {
CHECK(0, 0, -10, 4294967285UL, 32);
CHECK(0, 1, -10, 4294967285UL, 32);
CHECK(0, -1, -10, 4294967285UL, 32);
CHECK(0, -10, -10, 4294967285UL, 32);
CHECK(0, -10, -10, 4294967285UL, 32);
CHECK(0, 0x8babab, -10, 4294967285UL, 32);
CHECK(u, 0x8babab, 0, 4294967295UL, 32);
CHECK(u, 11, 10, 4294967205UL, 32);
CHECK(u, 10, 10, 4294967205UL, 32);
CHECK(u, 4294967205UL, 10, 4294967205UL, 32);
CHECK(u, 4294967205UL, 10, 4294967285UL, 32);
CHECK(0, 4294967205UL, -10, 4294967205UL, 32);
CHECK(0, 4294967205UL, -10, 4294967285UL, 32);
CHECK(u, 4294967295UL, 1, 4294967295UL, 32);
CHECK(u, 2000000000, 0, 4294967295UL, 32);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment