@ -42,6 +42,10 @@ void setCharacterLevel (Character *character, int newLevel) {
character->level = newLevel;
}
int getCharacterLevel (Character *character) {
return character->level;
void increaseStat (Character *character, int stat, int amount) {
switch (stat)
@ -28,5 +28,7 @@ int getCharacterIntelligence (Character *character);
void setCharacterLevel (Character *character, int newLevel);
int getCharacterLevel (Character *character);
void increaseStat (Character *character, int stat, int amount);
#endif
@ -69,6 +69,10 @@ void test_setCharacterLevel(void) {
TEST_ASSERT_EQUAL_INT(1,testCharacter.level);
void test_getCharacterLevel(void) {
TEST_ASSERT_EQUAL_INT(5,testCharacter2.level);
void test_increaseStat(void) {
increaseStat(&testCharacter2,STRENGTH,15);
TEST_ASSERT_EQUAL_INT(20,testCharacter2.strength);