You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

38 lines
734 B

#ifdef TEST
#include "unity.h"
#include "pong.h"
#define TEST_SCREEN_WIDTH 40
#define TEST_SCREEN_HEIGHT 20
char screen[TEST_SCREEN_HEIGHT][TEST_SCREEN_WIDTH+1];
void setUp(void){
//Wenn Funktion Vorraussetzungen braucht
}
void tearDown(void){
}
void test_clearScreen(void){
/* arrange */
int i, j;
for (i = 0; i < TEST_SCREEN_HEIGHT; i++) {
for (j = 0; j < TEST_SCREEN_WIDTH+1; j++) {
screen[i][j] = 'X';
}
screen[i][j-1] = '\0';
}
/* act */
clearScreen();
/* assert */
for (i = 0; i < TEST_SCREEN_HEIGHT; i++) {
for (j = 0; j < TEST_SCREEN_WIDTH+1; j++) {
TEST_ASSERT_EQUAL_INT(' ', screen[i][j]);
}
}
}
#endif // TEST