Skip to content

Commit 1792778

Browse files
committed
Add a test for BigInteger::operator<<
1 parent a0f9c5f commit 1792778

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/unittest/bigintegertest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ TEST(BigInteger, LeftShift) {
120120
EXPECT_TRUE(BIGINTEGER_LITERAL("4537899042132549697536") == a);
121121
a <<= 99;
122122
EXPECT_TRUE(BIGINTEGER_LITERAL("2876235222267216943024851750785644982682875244576768") == a);
123+
124+
a = 1;
125+
a <<= 64; // a.count_ != 1
126+
a <<= 256; // interShift == 0
127+
EXPECT_TRUE(BIGINTEGER_LITERAL("2135987035920910082395021706169552114602704522356652769947041607822219725780640550022962086936576") == a);
123128
}
124129

125130
TEST(BigInteger, Compare) {

0 commit comments

Comments
 (0)