Browse Source

Unittest02

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
6688a336ca
  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

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

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

10
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -71,12 +71,16 @@
:line: 228
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
:line: 242
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 17
:passed: 17
:total: 18
:passed: 18
:failed: 0
:ignored: 0
:stdout: []
:time: 0.04556480000019292
:time: 0.04488050000009025

2
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -27,6 +27,7 @@ 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);
extern void test_calculate_mines_HeightOne(void);
/*=======Mock Management=====*/
@ -108,6 +109,7 @@ int main(void)
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);
run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 242);
return UnityEnd();
}

13
src/test/test_duellist_spielesammlung_projekt.c

@ -239,6 +239,19 @@ void test_calculate_mines_HeightWidthOne(void)
TEST_ASSERT_EQUAL_INT(expected, result);
}
void test_calculate_mines_HeightOne(void)
{
/* arrange */
int height = 1;
int width = 5;
int expected = 0;
/* act */
int result = calculate_mines(height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(expected, result);
}
#endif // TEST

Loading…
Cancel
Save