Exemplo n.º 1
0
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;
    }
}
Exemplo n.º 2
0
    void testCase4() {
		string initial = "ZAXN";
		string current = "XNAZ";
		int expected_ = 4;
        assertEquals(4, expected_, solution.getCycle(initial, current));
    }
Exemplo n.º 3
0
    void testCase3() {
		string initial = "ABCD";
		string current = "ABDC";
		int expected_ = -1;
        assertEquals(3, expected_, solution.getCycle(initial, current));
    }
Exemplo n.º 4
0
    void testCase2() {
		string initial = "ABCD";
		string current = "CDBA";
		int expected_ = 4;
        assertEquals(2, expected_, solution.getCycle(initial, current));
    }
Exemplo n.º 5
0
    void testCase1() {
		string initial = "ABCD";
		string current = "DCAB";
		int expected_ = 2;
        assertEquals(1, expected_, solution.getCycle(initial, current));
    }