// // biginteger.t.h // bigdecimal // // Created by Sam Jaffe on 6/30/17. // #pragma once #include "biginteger.h" #include class biginteger_TestSuite : public CxxTest::TestSuite { public: void testAddPastBounds() { math::biginteger bi{999999999ULL}; TS_ASSERT_EQUALS((bi+1).to_string(), "1000000000"); } void testAddReciprocalIsZero() { math::biginteger bi{1000}; TS_ASSERT_EQUALS((bi+(-bi)).to_string(), "0"); } void testAddNegativeLargerGivesNegative() { math::biginteger bi{1000}; TS_ASSERT_EQUALS((bi+(-1001)).to_string(), "-1"); } void testAddNegativeSmallerGivesPositive() { math::biginteger bi{1000}; TS_ASSERT_EQUALS((bi+(-999)).to_string(), "1"); } };