X-Git-Url: https://git.draconx.ca/gitweb/dxcommon.git/blobdiff_plain/85d3347f01e3d27541e5d2fadf5ab49cc6cf54f9..4f94394a1e9aef0eaa98b52fe8421b62e3779682:/t/packtests64.c diff --git a/t/packtests64.c b/t/packtests64.c index a8fefe9..3a3f8e5 100644 --- a/t/packtests64.c +++ b/t/packtests64.c @@ -1,3 +1,13 @@ +/* + * Copyright © 2015, 2023 Nick Bowler + * + * Test application to verify 64-bit signed unpacking functions. + * + * License WTFPL2: Do What The Fuck You Want To Public License, version 2. + * This is free software: you are free to do what the fuck you want to. + * There is NO WARRANTY, to the extent permitted by law. + */ + #include "pack.h" #include "tap.h" @@ -17,8 +27,8 @@ static const unsigned char test_pattern[8] = { #define test(func, pattern, expected) do { \ long long result__ = (func)(pattern); \ if (!tap_result(result__ == (expected), "%s(%s)", #func, #expected)) { \ - tap_diag(" expected: %ld", (long long)(expected)); \ - tap_diag(" actual: %ld", result__); \ + tap_diag(" expected: %lld", (long long)(expected)); \ + tap_diag(" actual: %lld", result__); \ } \ } while (0) @@ -29,13 +39,13 @@ int main(void) test(unpack_s64_be, zero, 0); test(unpack_s64_be, minus_one, -1); - test(unpack_s64_be, test_pattern, -2401053088584709378); - test(unpack_s64_be, min, -9223372036854775807-1); + test(unpack_s64_be, test_pattern, -2401053088584709378ll); + test(unpack_s64_be, min, -9223372036854775807ll-1); test(unpack_s64_le, zero, 0); test(unpack_s64_le, minus_one, -1); - test(unpack_s64_le, test_pattern, -87241914314740258); - test(unpack_s64_le, min+1, -9223372036854775807-1); + test(unpack_s64_le, test_pattern, -87241914314740258ll); + test(unpack_s64_le, min+1, -9223372036854775807ll-1); #else tap_skip_all("no 64-bit support"); #endif