|
@ -41,3 +41,59 @@ void test_Scheresteinpapier_generateRandom(void) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_Scheresteinpapier_determineWinner(void) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int spieler = 0; spieler <= 2; ++spieler) { |
|
|
|
|
|
|
|
|
|
|
|
for (int computer = 0; computer <= 2; ++computer) { |
|
|
|
|
|
|
|
|
|
|
|
int result = determineWinner(spieler, computer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((spieler == 0 && computer == 2) || |
|
|
|
|
|
|
|
|
|
|
|
(spieler == 1 && computer == 0) || |
|
|
|
|
|
|
|
|
|
|
|
(spieler == 2 && computer == 1)) { |
|
|
|
|
|
|
|
|
|
|
|
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( |
|
|
|
|
|
|
|
|
|
|
|
((void *)0) |
|
|
|
|
|
|
|
|
|
|
|
), (UNITY_UINT)(35), UNITY_DISPLAY_STYLE_INT); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else if (spieler == computer) { |
|
|
|
|
|
|
|
|
|
|
|
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), ( |
|
|
|
|
|
|
|
|
|
|
|
((void *)0) |
|
|
|
|
|
|
|
|
|
|
|
), (UNITY_UINT)(38), UNITY_DISPLAY_STYLE_INT); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
|
|
|
|
UnityAssertEqualNumber((UNITY_INT)((-1)), (UNITY_INT)((result)), ( |
|
|
|
|
|
|
|
|
|
|
|
((void *)0) |
|
|
|
|
|
|
|
|
|
|
|
), (UNITY_UINT)(41), UNITY_DISPLAY_STYLE_INT); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |