diff --git a/src/c/character.c b/src/c/character.c index 5938afa..d529731 100644 --- a/src/c/character.c +++ b/src/c/character.c @@ -31,4 +31,8 @@ int getCharacterDexterity (Character *character) { void setCharacterIntelligence (Character *character, int newIntelligence) { character->intelligence = newIntelligence; +} + +int getCharacterIntelligence (Character *character) { + return character->intelligence; } \ No newline at end of file diff --git a/src/c/character.h b/src/c/character.h index a5960fe..80b6dd1 100644 --- a/src/c/character.h +++ b/src/c/character.h @@ -20,4 +20,6 @@ int getCharacterDexterity (Character *character); void setCharacterIntelligence (Character *character, int newIntelligence); +int getCharacterIntelligence (Character *character); + #endif \ No newline at end of file diff --git a/test/c/test_character.c b/test/c/test_character.c index c204b09..e216d43 100644 --- a/test/c/test_character.c +++ b/test/c/test_character.c @@ -13,7 +13,7 @@ void setUp(void) testCharacter.dexterity = 0; testCharacter2.dexterity = 5; testCharacter.intelligence = 0; - testCharacter2.intelligence = 5; + testCharacter2.intelligence = 7; } void tearDown(void) @@ -56,4 +56,8 @@ void test_setCharacterIntelligence(void) { TEST_ASSERT_EQUAL_INT(45,testCharacter.intelligence); } +void test_getCharacterIntelligence(void) { + TEST_ASSERT_EQUAL_INT(7,testCharacter2.intelligence); +} + #endif // TEST \ No newline at end of file