Loading tests/LabOne.cpp +27 −18 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ bool test_labOne_pOne() { // example 1 Common::redirIO("2"); labOne_pOne(); int out = stoi(Common::restoreIO()); int out = Common::getInt(Common::restoreIO()); if (out!=5) return false; Loading @@ -67,6 +67,11 @@ bool test_labOne_pTwo() { string line; int sum = 0; while (getline(stream, line)) { // ignore lines that have "Input:" or "Output:" if ( (line.find("Input:") == string::npos) && (line.find("Output:") == string::npos) ) sum += line.length(); } Loading @@ -86,7 +91,11 @@ bool test_labOne_pThree() { string line; int sum = 0; while (getline(stream, line)) { sum += stoi(line); if ( (line.find("Input:") == string::npos) && (line.find("Output:") == string::npos) ) sum += Common::getInt(line); } if (sum==132) Loading Loading
tests/LabOne.cpp +27 −18 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ bool test_labOne_pOne() { // example 1 Common::redirIO("2"); labOne_pOne(); int out = stoi(Common::restoreIO()); int out = Common::getInt(Common::restoreIO()); if (out!=5) return false; Loading @@ -67,6 +67,11 @@ bool test_labOne_pTwo() { string line; int sum = 0; while (getline(stream, line)) { // ignore lines that have "Input:" or "Output:" if ( (line.find("Input:") == string::npos) && (line.find("Output:") == string::npos) ) sum += line.length(); } Loading @@ -86,7 +91,11 @@ bool test_labOne_pThree() { string line; int sum = 0; while (getline(stream, line)) { sum += stoi(line); if ( (line.find("Input:") == string::npos) && (line.find("Output:") == string::npos) ) sum += Common::getInt(line); } if (sum==132) Loading