Browse Source

Unittest11

remotes/origin/Daniel
Daniel M 11 months ago
parent
commit
7cc53f1b33
  1. 32
      build/test/cache/test_duellist_spielesammlung_projekt.c
  2. BIN
      build/test/out/c/duellist-spielesammlung-projekt.o
  3. BIN
      build/test/out/c/test_duellist_spielesammlung_projekt.o
  4. BIN
      build/test/out/c/test_duellist_spielesammlung_projekt_runner.o
  5. BIN
      build/test/out/test_duellist_spielesammlung_projekt.out
  6. 32
      build/test/preprocess/files/test_duellist_spielesammlung_projekt.c
  7. 10
      build/test/results/test_duellist_spielesammlung_projekt.pass
  8. 2
      build/test/runners/test_duellist_spielesammlung_projekt_runner.c
  9. 14
      src/test/test_duellist_spielesammlung_projekt.c

32
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -867,3 +867,35 @@ void test_calculate_mines_HeightWidthAgan(void)
), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT);
} }
void test_calculate_mines_HeightWidthRoundUp(void)
{
int height = 3;
int width = 5;
int expected = 3;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT);
}

BIN
build/test/out/c/duellist-spielesammlung-projekt.o

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

@ -867,3 +867,35 @@ void test_calculate_mines_HeightWidthAgan(void)
), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(381), UNITY_DISPLAY_STYLE_INT);
} }
void test_calculate_mines_HeightWidthRoundUp(void)
{
int height = 3;
int width = 5;
int expected = 3;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(395), UNITY_DISPLAY_STYLE_INT);
}

10
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -107,12 +107,16 @@
:line: 370 :line: 370
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_calculate_mines_HeightWidthRoundUp
:line: 384
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 26
:passed: 26
:total: 27
:passed: 27
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.05030940000051487
:time: 0.04867079999985435

2
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -36,6 +36,7 @@ extern void test_create_minefield_NegativeDimensions(void);
extern void test_calculate_mines_HeightZero(void); 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);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -126,6 +127,7 @@ int main(void)
run_test(test_calculate_mines_HeightZero, "test_calculate_mines_HeightZero", 342); run_test(test_calculate_mines_HeightZero, "test_calculate_mines_HeightZero", 342);
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);
return UnityEnd(); return UnityEnd();
} }

14
src/test/test_duellist_spielesammlung_projekt.c

@ -381,4 +381,18 @@ void test_calculate_mines_HeightWidthAgan(void)
TEST_ASSERT_EQUAL_INT(expected, result); TEST_ASSERT_EQUAL_INT(expected, result);
} }
void test_calculate_mines_HeightWidthRoundUp(void)
{
/* arrange */
int height = 3;
int width = 5;
int expected = 3;
/* act */
int result = calculate_mines(height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(expected, result);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save