mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
25 lines
861 B
C++
25 lines
861 B
C++
|
#include <gtest/gtest.h>
|
||
|
#include <common/extended_types.h>
|
||
|
#include <IO/WriteHelpers.h>
|
||
|
|
||
|
using namespace DB;
|
||
|
|
||
|
|
||
|
GTEST_TEST(WideInteger, Tests)
|
||
|
{
|
||
|
ASSERT_EQ(toString(UInt128(12345678901234567890ULL)), "12345678901234567890");
|
||
|
ASSERT_EQ(toString(UInt256(12345678901234567890ULL)), "12345678901234567890");
|
||
|
|
||
|
ASSERT_EQ(toString(Int128(-1234567890123456789LL)), "-1234567890123456789");
|
||
|
ASSERT_EQ(toString(Int256(-1234567890123456789LL)), "-1234567890123456789");
|
||
|
|
||
|
ASSERT_EQ(UInt64(UInt128(12345678901234567890ULL)), 12345678901234567890ULL);
|
||
|
ASSERT_EQ(UInt64(UInt256(12345678901234567890ULL)), 12345678901234567890ULL);
|
||
|
|
||
|
ASSERT_EQ(__uint128_t(UInt128(12345678901234567890ULL)), 12345678901234567890ULL);
|
||
|
ASSERT_EQ(__uint128_t(UInt256(12345678901234567890ULL)), 12345678901234567890ULL);
|
||
|
|
||
|
ASSERT_EQ(toString(Int256(-1)), "-1");
|
||
|
}
|
||
|
|