From d5b5b5ed0c62ab47003f570a43596fff7c66c6bf Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Sun, 22 Jul 2018 00:42:10 +0100 Subject: [PATCH] Add more tests --- test/unit/int_conv_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/int_conv_test.cpp b/test/unit/int_conv_test.cpp index 795c358..5f2086b 100644 --- a/test/unit/int_conv_test.cpp +++ b/test/unit/int_conv_test.cpp @@ -89,4 +89,12 @@ TEST_CASE ("Check int to char array conversions", "[s2i][int_conv]") { CHECK(to_string_view(int_to_ary(0b11111111)) == "11111111"); CHECK(to_string_view(int_to_ary(0b111100001111)) == "111100001111"); CHECK(to_string_view(int_to_ary(0b111100001111)) == "111100001111"); + CHECK(to_string_view(int_to_ary(9223372036854775807)) == "1y2p0ij32e8e7"); + CHECK(to_string_view(int_to_ary(0x8000000000000001)) == "1y2p0ij32e8e9"); +#if defined(__GNUC__) + __int128_t num = 10000000000000000000U; + CHECK(to_string_view(int_to_ary<__int128_t, 10>(num * 100)) == "1000000000000000000000"); + num = 0xFFFFFFFFFFFFFFFF; + CHECK(to_string_view(int_to_ary<__int128_t, 16>(num * 0x10000 + 0xffff)) == "ffffffffffffffffffff"); +#endif }