static void run() { testSum(); testSubtraction(); testMulitplication(); testDivision(); testSign(); }
void start() { testAddition(); testSubtraction(); testFailure(); suite->runNextCase(); }
static void testSubtraction() { testSubtraction(1, 2, "-1.000000"); testSubtraction(100, -100, "200.000000"); testSubtraction(100, -10, "110.000000"); testSubtraction(0, 0, "0.000000"); testSubtraction(1, 123456789, "-123456788.000000"); testSubtraction(0.5, 1.5, "-1.000000"); testSubtraction(0.5, 1.2, "-0.700000"); }
int testRealNumber() { cout << "Testing RealNumber... ClassBasics \t- " << (testClassBasics() ? "OKAY" : "FAILURE") << endl; cout << "Testing RealNumber... Addition \t\t- " << (testAddition() ? "OKAY" : "FAILURE") << endl; cout << "Testing RealNumber... Subtraction \t- " << (testSubtraction() ? "OKAY" : "FAILURE") << endl; cout << "Testing RealNumber... Multiplication \t- " << (testMultiplication() ? "OKAY" : "FAILURE") << endl; cout << "Testing RealNumber... Division \t\t- " << (testDivision() ? "OKAY" : "FAILURE") << endl; cout << endl; return 0; }