Browse Source

Unittest12

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
14719d38ed
  1. 32
      build/test/cache/test_duellist_spielesammlung_projekt.c
  2. BIN
      build/test/out/c/test_duellist_spielesammlung_projekt.o
  3. BIN
      build/test/out/c/test_duellist_spielesammlung_projekt_runner.o
  4. BIN
      build/test/out/test_duellist_spielesammlung_projekt.out
  5. 32
      build/test/preprocess/files/test_duellist_spielesammlung_projekt.c
  6. 10
      build/test/results/test_duellist_spielesammlung_projekt.pass
  7. 2
      build/test/runners/test_duellist_spielesammlung_projekt_runner.c
  8. 13
      src/test/test_duellist_spielesammlung_projekt.c

32
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -899,3 +899,35 @@ void test_calculate_mines_HeightWidthRoundUp(void)
), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT);
} }
void test_calculate_mines_HeightWidthNoRound(void)
{
int height = 9;
int width = 9;
int expected = 20;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT);
}

BIN
build/test/out/c/test_duellist_spielesammlung_projekt.o

BIN
build/test/out/c/test_duellist_spielesammlung_projekt_runner.o

BIN
build/test/out/test_duellist_spielesammlung_projekt.out

32
build/test/preprocess/files/test_duellist_spielesammlung_projekt.c

@ -899,3 +899,35 @@ void test_calculate_mines_HeightWidthRoundUp(void)
), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT);
} }
void test_calculate_mines_HeightWidthNoRound(void)
{
int height = 9;
int width = 9;
int expected = 20;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT);
}

10
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -111,12 +111,16 @@
:line: 384 :line: 384
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_calculate_mines_HeightWidthNoRound
:line: 398
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 27
:passed: 27
:total: 28
:passed: 28
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.04867079999985435
:time: 0.050488599999880535

2
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -37,6 +37,7 @@ extern void test_calculate_mines_HeightZero(void);
extern void test_calculate_mines_HeightWidthNumber(void); extern void test_calculate_mines_HeightWidthNumber(void);
extern void test_calculate_mines_HeightWidthAgan(void); extern void test_calculate_mines_HeightWidthAgan(void);
extern void test_calculate_mines_HeightWidthRoundUp(void); extern void test_calculate_mines_HeightWidthRoundUp(void);
extern void test_calculate_mines_HeightWidthNoRound(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -128,6 +129,7 @@ int main(void)
run_test(test_calculate_mines_HeightWidthNumber, "test_calculate_mines_HeightWidthNumber", 356); run_test(test_calculate_mines_HeightWidthNumber, "test_calculate_mines_HeightWidthNumber", 356);
run_test(test_calculate_mines_HeightWidthAgan, "test_calculate_mines_HeightWidthAgan", 370); run_test(test_calculate_mines_HeightWidthAgan, "test_calculate_mines_HeightWidthAgan", 370);
run_test(test_calculate_mines_HeightWidthRoundUp, "test_calculate_mines_HeightWidthRoundUp", 384); run_test(test_calculate_mines_HeightWidthRoundUp, "test_calculate_mines_HeightWidthRoundUp", 384);
run_test(test_calculate_mines_HeightWidthNoRound, "test_calculate_mines_HeightWidthNoRound", 398);
return UnityEnd(); return UnityEnd();
} }

13
src/test/test_duellist_spielesammlung_projekt.c

@ -395,4 +395,17 @@ void test_calculate_mines_HeightWidthRoundUp(void)
TEST_ASSERT_EQUAL_INT(expected, result); TEST_ASSERT_EQUAL_INT(expected, result);
} }
void test_calculate_mines_HeightWidthNoRound(void)
{
/* arrange */
int height = 9;
int width = 9;
int expected = 20;
/* act */
int result = calculate_mines(height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(expected, result);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save