From 520b94900528428a6aec812ce7da43c011e28021 Mon Sep 17 00:00:00 2001 From: Kai Kehres Date: Thu, 12 Jan 2023 19:15:22 +0100 Subject: [PATCH] prod/test: created getCharacterDexterity and test_getCharacterDexterity --- src/c/character.c | 4 ++++ src/c/character.h | 2 ++ test/c/test_character.c | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/src/c/character.c b/src/c/character.c index b0ff012..d9642ca 100644 --- a/src/c/character.c +++ b/src/c/character.c @@ -23,4 +23,8 @@ int getCharacterStrength (Character *character) { void setCharacterDexterity (Character *character, int newDexterity) { character->dexterity = newDexterity; +} + +int getCharacterDexterity (Character *character) { + return character->dexterity; } \ No newline at end of file diff --git a/src/c/character.h b/src/c/character.h index 55ce4eb..a0345e3 100644 --- a/src/c/character.h +++ b/src/c/character.h @@ -16,4 +16,6 @@ int getCharacterStrength(Character *character); void setCharacterDexterity (Character *character, int newDexterity); +int getCharacterDexterity(Character *character); + #endif \ No newline at end of file diff --git a/test/c/test_character.c b/test/c/test_character.c index 0119f86..0f12bcc 100644 --- a/test/c/test_character.c +++ b/test/c/test_character.c @@ -44,4 +44,9 @@ void test_setCharacterDexterity(void) { TEST_ASSERT_EQUAL_INT(50,testCharacter.dexterity); } + +void test_getCharacterDexterity(void) { + TEST_ASSERT_EQUAL_INT(5,testCharacter2.dexterity); +} + #endif // TEST \ No newline at end of file