@ -36,5 +36,6 @@ void *setEnemyHealth(int *num, int health){
}
int getEnemyHealth(enemy enemy){
//gibt health zurück, benötigt keine adress pointer
return enemy.health;
@ -9,6 +9,7 @@ typedef struct {
//setEnemyHealth(&enemy.health, health);
void *setEnemyHealth(int *num, int health);
int getEnemyHealth(enemy enemy);
bool playerAlive(int health);
int playerHealth(int health, int damage);
@ -54,6 +54,15 @@ void test_setEnemyHealth(void){
TEST_ASSERT_EQUAL(health, test.health);
void test_getEnemyHealth(void){
//arrange
int health = 50;
//act
enemy test = {health};
//assert
TEST_ASSERT_EQUAL(health, getEnemyHealth(test));
#endif // TEST