21 #define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1) 23 static const BigInteger
kZero(0);
24 static const BigInteger
kOne(1);
28 TEST(BigInteger, Constructor) {
29 EXPECT_TRUE(
kZero.IsZero());
34 const BigInteger
a(123);
39 EXPECT_EQ(2u,
kTwo64.GetCount());
40 EXPECT_EQ(0u,
kTwo64.GetDigit(0));
41 EXPECT_EQ(1u,
kTwo64.GetDigit(1));
44 TEST(BigInteger, AddUint64) {
47 EXPECT_TRUE(
kZero == a);
50 EXPECT_TRUE(
kOne == a);
53 EXPECT_TRUE(BigInteger(2) == a);
63 TEST(BigInteger, MultiplyUint64) {
66 EXPECT_TRUE(
kZero == a);
68 EXPECT_TRUE(
kZero == a);
72 EXPECT_TRUE(
kOne == b);
74 EXPECT_TRUE(
kZero == b);
78 EXPECT_TRUE(BigInteger(123u * 456u) == c);
85 TEST(BigInteger, MultiplyUint32) {
88 EXPECT_TRUE(
kZero == a);
90 EXPECT_TRUE(
kZero == a);
94 EXPECT_TRUE(
kOne == b);
96 EXPECT_TRUE(
kZero == b);
100 EXPECT_TRUE(BigInteger(123u * 456u) == c);
110 EXPECT_TRUE(
kZero == a);
112 EXPECT_TRUE(
kZero == a);
116 EXPECT_TRUE(BigInteger(123) == a);
118 EXPECT_TRUE(BigInteger(246) == a);
122 EXPECT_TRUE(
BIGINTEGER_LITERAL(
"2876235222267216943024851750785644982682875244576768") == a);
static const BigInteger kZero(0)
static const BigInteger kTwo64
#define RAPIDJSON_UINT64_C2(high32, low32)
Construct a 64-bit literal by a pair of 32-bit integer.
static const BigInteger kOne(1)
unsigned __int64 uint64_t
static const BigInteger kUint64Max
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define BIGINTEGER_LITERAL(s)
TEST(BigInteger, Constructor)