bool do_test(string source, string __expected) { time_t startClock = clock(); QuiningTopCoder *instance = new QuiningTopCoder(); string __result = instance->testCode(source); double elapsed = (double)(clock() - startClock) / CLOCKS_PER_SEC; delete instance; if (__result == __expected) { cout << "PASSED!" << " (" << elapsed << " seconds)" << endl; return true; } else { cout << "FAILED!" << " (" << elapsed << " seconds)" << endl; cout << " Expected: " << to_string(__expected) << endl; cout << " Received: " << to_string(__result) << endl; return false; } }
void testCase5() { string source = "#R,#:+1+:#,R#"; string expected_ = "QUINES 97"; assertEquals(5, expected_, solution.testCode(source)); }
void testCase6() { string source = "R,#1+1:"; string expected_ = "MISMATCH 7"; assertEquals(6, expected_, solution.testCode(source)); }
void testCase4() { string source = "0,1+::9W-9W-S1W1W:+2_J_@_@"; string expected_ = "BADEND 437"; assertEquals(4, expected_, solution.testCode(source)); }
void testCase3() { string source = "0,1+:#@:$1J"; string expected_ = "QUINES 91"; assertEquals(3, expected_, solution.testCode(source)); }
void testCase2() { string source = "1:+:1J"; string expected_ = "OVERFLOW 147"; assertEquals(2, expected_, solution.testCode(source)); }
void testCase1() { string source = "_"; string expected_ = "TIMEOUT"; assertEquals(1, expected_, solution.testCode(source)); }
void testCase0() { string source = ","; string expected_ = "QUINES 0"; assertEquals(0, expected_, solution.testCode(source)); }