bool do_test(string initial, string current, int __expected) { time_t startClock = clock(); TireRotation *instance = new TireRotation(); int __result = instance->getCycle(initial, current); 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 testCase4() { string initial = "ZAXN"; string current = "XNAZ"; int expected_ = 4; assertEquals(4, expected_, solution.getCycle(initial, current)); }
void testCase3() { string initial = "ABCD"; string current = "ABDC"; int expected_ = -1; assertEquals(3, expected_, solution.getCycle(initial, current)); }
void testCase2() { string initial = "ABCD"; string current = "CDBA"; int expected_ = 4; assertEquals(2, expected_, solution.getCycle(initial, current)); }
void testCase1() { string initial = "ABCD"; string current = "DCAB"; int expected_ = 2; assertEquals(1, expected_, solution.getCycle(initial, current)); }