Browse Source

Unittest03

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
dbcfaa712a
  1. 34
      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. 34
      build/test/preprocess/files/test_duellist_spielesammlung_projekt.c
  6. 12
      build/test/results/test_duellist_spielesammlung_projekt.pass
  7. 4
      build/test/runners/test_duellist_spielesammlung_projekt_runner.c
  8. 14
      src/test/test_duellist_spielesammlung_projekt.c

34
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -542,6 +542,38 @@ void test_calculate_mines_HeightWidthOne(void)
void test_calculate_mines_WidthOne(void)
{
int height = 5;
int width = 1;
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);
}
void test_calculate_mines_HeightOne(void)
{
@ -568,6 +600,6 @@ void test_calculate_mines_HeightOne(void)
((void *)0)
), (UNITY_UINT)(253), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(267), 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

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

@ -542,6 +542,38 @@ void test_calculate_mines_HeightWidthOne(void)
void test_calculate_mines_WidthOne(void)
{
int height = 5;
int width = 1;
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);
}
void test_calculate_mines_HeightOne(void)
{
@ -568,6 +600,6 @@ void test_calculate_mines_HeightOne(void)
((void *)0)
), (UNITY_UINT)(253), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
}

12
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -71,16 +71,20 @@
:line: 228
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
- :test: test_calculate_mines_WidthOne
:line: 242
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
:line: 256
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 18
:passed: 18
:total: 19
:passed: 19
:failed: 0
:ignored: 0
:stdout: []
:time: 0.04488050000009025
:time: 0.04574930000035238

4
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_WidthOne(void);
extern void test_calculate_mines_HeightOne(void);
@ -109,7 +110,8 @@ 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);
run_test(test_calculate_mines_WidthOne, "test_calculate_mines_WidthOne", 242);
run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 256);
return UnityEnd();
}

14
src/test/test_duellist_spielesammlung_projekt.c

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

Loading…
Cancel
Save