| 1234567891011121314151617181920212223242526272829303132333435 |
- //
- // biginteger.t.h
- // bigdecimal
- //
- // Created by Sam Jaffe on 6/30/17.
- //
- #pragma once
- #include "biginteger.h"
- #include <cxxtest/TestSuite.h>
- 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");
- }
- };
|