From 3d4a9e9f4dcc1711d952a7a7eb76512acef464f5 Mon Sep 17 00:00:00 2001 From: Kai Kehres Date: Thu, 12 Jan 2023 19:02:46 +0100 Subject: [PATCH] prod/test: created getCharacterStrength and test_getCharacterStrength --- src/c/character.c | 4 ++++ src/c/character.h | 2 +- test/c/test_character.c | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/c/character.c b/src/c/character.c index 1664eea..9d3517e 100644 --- a/src/c/character.c +++ b/src/c/character.c @@ -17,3 +17,7 @@ void setCharacterStrength(Character *character, int newStrength) { character->strength = newStrength; } + +int getCharacterStrength(Character *character) { + return character->strength; +} diff --git a/src/c/character.h b/src/c/character.h index 999692c..2396bc7 100644 --- a/src/c/character.h +++ b/src/c/character.h @@ -12,6 +12,6 @@ int getCharacterHealthPoints (Character *character); void setCharacterStrength (Character *character, int newStrength); - +int getCharacterStrength(Character *character) #endif \ No newline at end of file diff --git a/test/c/test_character.c b/test/c/test_character.c index 3e26839..d4012d2 100644 --- a/test/c/test_character.c +++ b/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 \ No newline at end of file