Browse Source

prod/test: created getCharacterStrength and test_getCharacterStrength

remotes/origin/characterStats
Kai Kehres 2 years ago
parent
commit
3d4a9e9f4d
  1. 4
      src/c/character.c
  2. 2
      src/c/character.h
  3. 4
      test/c/test_character.c

4
src/c/character.c

@ -17,3 +17,7 @@ void setCharacterStrength(Character *character, int newStrength)
{
character->strength = newStrength;
}
int getCharacterStrength(Character *character) {
return character->strength;
}

2
src/c/character.h

@ -12,6 +12,6 @@ int getCharacterHealthPoints (Character *character);
void setCharacterStrength (Character *character, int newStrength);
int getCharacterStrength(Character *character)
#endif

4
test/c/test_character.c

@ -33,6 +33,8 @@ void test_setCharacterStrenght(void)
TEST_ASSERT_EQUAL_INT(50,testCharacter.strength);
}
void test_getCharacterStrength(void) {
TEST_ASSERT_EQUAL_INT(5,testCharacter2.strength);
}
#endif // TEST
Loading…
Cancel
Save