Browse Source

Unittest05

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
5431ab49dc
  1. 76
      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. 76
      build/test/preprocess/files/test_duellist_spielesammlung_projekt.c
  6. 16
      build/test/results/test_duellist_spielesammlung_projekt.pass
  7. 6
      build/test/runners/test_duellist_spielesammlung_projekt_runner.c
  8. 19
      src/test/test_duellist_spielesammlung_projekt.c

76
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -574,6 +574,80 @@ void test_calculate_mines_WidthOne(void)
void test_calculate_mines_NormalCase(void)
{
int height = 5;
int width = 5;
int expected = 6;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
}
void test_end_check_AllUncovered_NoMines(void)
{
char* minefield[] = { "000",
"000",
"000" };
char* mines[] = { "000",
"000",
"000" };
int height = 3;
int width = 3;
int result = end_check(minefield, mines, height, width);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(286), UNITY_DISPLAY_STYLE_INT);
}
void test_calculate_mines_HeightOne(void)
{
@ -600,6 +674,6 @@ void test_calculate_mines_HeightOne(void)
((void *)0)
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(300), 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

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

@ -574,6 +574,80 @@ void test_calculate_mines_WidthOne(void)
void test_calculate_mines_NormalCase(void)
{
int height = 5;
int width = 5;
int expected = 6;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
}
void test_end_check_AllUncovered_NoMines(void)
{
char* minefield[] = { "000",
"000",
"000" };
char* mines[] = { "000",
"000",
"000" };
int height = 3;
int width = 3;
int result = end_check(minefield, mines, height, width);
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(286), UNITY_DISPLAY_STYLE_INT);
}
void test_calculate_mines_HeightOne(void)
{
@ -600,6 +674,6 @@ void test_calculate_mines_HeightOne(void)
((void *)0)
), (UNITY_UINT)(267), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(300), UNITY_DISPLAY_STYLE_INT);
}

16
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -75,16 +75,24 @@
:line: 242
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
- :test: test_calculate_mines_NormalCase
:line: 256
:message: ''
:unity_test_time: 0
- :test: test_end_check_AllUncovered_NoMines
:line: 270
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightOne
:line: 289
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 19
:passed: 19
:total: 21
:passed: 21
:failed: 0
:ignored: 0
:stdout: []
:time: 0.04574930000035238
:time: 0.04708719999962341

6
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -28,6 +28,8 @@ 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_NormalCase(void);
extern void test_end_check_AllUncovered_NoMines(void);
extern void test_calculate_mines_HeightOne(void);
@ -111,7 +113,9 @@ int main(void)
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_WidthOne, "test_calculate_mines_WidthOne", 242);
run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 256);
run_test(test_calculate_mines_NormalCase, "test_calculate_mines_NormalCase", 256);
run_test(test_end_check_AllUncovered_NoMines, "test_end_check_AllUncovered_NoMines", 270);
run_test(test_calculate_mines_HeightOne, "test_calculate_mines_HeightOne", 289);
return UnityEnd();
}

19
src/test/test_duellist_spielesammlung_projekt.c

@ -267,6 +267,25 @@ void test_calculate_mines_NormalCase(void)
TEST_ASSERT_EQUAL_INT(expected, result);
}
void test_end_check_AllUncovered_NoMines(void)
{
/* arrange */
char* minefield[] = { "000",
"000",
"000" };
char* mines[] = { "000",
"000",
"000" };
int height = 3;
int width = 3;
/* act */
int result = end_check(minefield, mines, height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(1, result);
}
void test_calculate_mines_HeightOne(void)
{
/* arrange */

Loading…
Cancel
Save