double test2() {
	string p0 = "WWWWWWWWW";
	BlackAndWhiteSolitaire * obj = new BlackAndWhiteSolitaire();
	clock_t start = clock();
	int my_answer = obj->minimumTurns(p0);
	clock_t end = clock();
	delete obj;
	cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl;
	int p1 = 4;
	cout <<"Desired answer: " <<endl;
	cout <<"\t" << p1 <<endl;
	cout <<"Your answer: " <<endl;
	cout <<"\t" << my_answer <<endl;
	if (p1 != my_answer) {
		cout <<"DOESN'T MATCH!!!!" <<endl <<endl;
		return -1;
	}
	else {
		cout <<"Match :-)" <<endl <<endl;
		return (double)(end-start)/CLOCKS_PER_SEC;
	}
}
Beispiel #2
0
    void testCase2() {
		string cardFront = "WWWWWWWWW";
		int expected_ = 4;
        assertEquals(2, expected_, solution.minimumTurns(cardFront));
    }
Beispiel #3
0
    void testCase3() {
		string cardFront = "BBWBWWBWBWWBBBWBWBWBBWBBW";
		int expected_ = 10;
        assertEquals(3, expected_, solution.minimumTurns(cardFront));
    }
Beispiel #4
0
    void testCase1() {
		string cardFront = "WBWBW";
		int expected_ = 0;
        assertEquals(1, expected_, solution.minimumTurns(cardFront));
    }