Test Bench
Test Bench
int main() {
StatsInfo testData;
cout << "Beginning tests." << endl;
testData.SetNum1(100);
if (testData.GetNum1() != 100) {
cout << " FAILED set/get num1" << endl;
}
testData.SetNum2(50);
if (testData.GetNum2() != 50) {
cout << " FAILED set/get num2" << endl;
}
testData.SetNum1(10);
testData.SetNum2(20);
if (testData.GetAverage() != 15) {
cout << " FAILED GetAverage for 10, 20" << endl;
}
testData.SetNum1(-10);
testData.SetNum2(0);
if (testData.GetAverage() != -5) {
cout << " FAILED GetAverage for -10, 0" << endl;
}
cout << "Tests complete." << endl;
return 0;
}