Browse Source

Unittest01

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
1ca286fd72
  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. 15
      src/test/test_duellist_spielesammlung_projekt.c

32
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -507,3 +507,35 @@ void test_FieldEmpty_returns_false_for_nonempty_field(void) {
), (UNITY_UINT)(225), UNITY_DISPLAY_STYLE_INT);
}
void test_calculate_mines_HeightWidthOne(void)
{
int height = 1;
int width = 1;
int expected = 0;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(239), 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

@ -507,3 +507,35 @@ void test_FieldEmpty_returns_false_for_nonempty_field(void) {
), (UNITY_UINT)(225), UNITY_DISPLAY_STYLE_INT);
}
void test_calculate_mines_HeightWidthOne(void)
{
int height = 1;
int width = 1;
int expected = 0;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(239), UNITY_DISPLAY_STYLE_INT);
}

10
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -67,12 +67,16 @@
:line: 215
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthOne
:line: 228
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 16
:passed: 16
:total: 17
:passed: 17
:failed: 0
:ignored: 0
:stdout: []
:time: 0.01351129999989098
:time: 0.04556480000019292

2
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -26,6 +26,7 @@ extern void test_BoardFull_returns_true_when_board_is_full(void);
extern void test_CurrentPlayer_returns_correct_player(void);
extern void test_FieldEmpty_returns_true_for_empty_field(void);
extern void test_FieldEmpty_returns_false_for_nonempty_field(void);
extern void test_calculate_mines_HeightWidthOne(void);
/*=======Mock Management=====*/
@ -106,6 +107,7 @@ int main(void)
run_test(test_CurrentPlayer_returns_correct_player, "test_CurrentPlayer_returns_correct_player", 189);
run_test(test_FieldEmpty_returns_true_for_empty_field, "test_FieldEmpty_returns_true_for_empty_field", 202);
run_test(test_FieldEmpty_returns_false_for_nonempty_field, "test_FieldEmpty_returns_false_for_nonempty_field", 215);
run_test(test_calculate_mines_HeightWidthOne, "test_calculate_mines_HeightWidthOne", 228);
return UnityEnd();
}

15
src/test/test_duellist_spielesammlung_projekt.c

@ -225,6 +225,21 @@ void test_FieldEmpty_returns_false_for_nonempty_field(void) {
TEST_ASSERT_EQUAL(0, result);
}
void test_calculate_mines_HeightWidthOne(void)
{
/* arrange */
int height = 1;
int width = 1;
int expected = 0;
/* act */
int result = calculate_mines(height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(expected, result);
}
#endif // TEST

Loading…
Cancel
Save