Browse Source

Merge branch 'Daniel' into 'main'

Daniel

See merge request fdai7745/duellist-spielesammlung-projekt!17
remotes/origin/Areeb
fdai7745 11 months ago
parent
commit
93a7c5cf2a
  1. 96
      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. 96
      build/test/preprocess/files/test_duellist_spielesammlung_projekt.c
  7. 18
      build/test/results/test_duellist_spielesammlung_projekt.pass
  8. 6
      build/test/runners/test_duellist_spielesammlung_projekt_runner.c
  9. 41
      src/test/test_duellist_spielesammlung_projekt.c

96
build/test/cache/test_duellist_spielesammlung_projekt.c

@ -867,3 +867,99 @@ void test_calculate_mines_HeightWidthAgan(void)
), (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);
}
void test_calculate_mines_HeightWidthNoRound(void)
{
int height = 9;
int width = 9;
int expected = 20;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT);
}
void test_calculate_mines_HeightWidthFinal(void)
{
int height = 7;
int width = 7;
int expected = 12;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(423), 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

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

@ -867,3 +867,99 @@ void test_calculate_mines_HeightWidthAgan(void)
), (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);
}
void test_calculate_mines_HeightWidthNoRound(void)
{
int height = 9;
int width = 9;
int expected = 20;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(409), UNITY_DISPLAY_STYLE_INT);
}
void test_calculate_mines_HeightWidthFinal(void)
{
int height = 7;
int width = 7;
int expected = 12;
int result = calculate_mines(height, width);
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(423), UNITY_DISPLAY_STYLE_INT);
}

18
build/test/results/test_duellist_spielesammlung_projekt.pass

@ -107,12 +107,24 @@
:line: 370
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthRoundUp
:line: 384
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthNoRound
:line: 398
:message: ''
:unity_test_time: 0
- :test: test_calculate_mines_HeightWidthFinal
:line: 412
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 26
:passed: 26
:total: 29
:passed: 29
:failed: 0
:ignored: 0
:stdout: []
:time: 0.05030940000051487
:time: 0.05077199999959703

6
build/test/runners/test_duellist_spielesammlung_projekt_runner.c

@ -36,6 +36,9 @@ extern void test_create_minefield_NegativeDimensions(void);
extern void test_calculate_mines_HeightZero(void);
extern void test_calculate_mines_HeightWidthNumber(void);
extern void test_calculate_mines_HeightWidthAgan(void);
extern void test_calculate_mines_HeightWidthRoundUp(void);
extern void test_calculate_mines_HeightWidthNoRound(void);
extern void test_calculate_mines_HeightWidthFinal(void);
/*=======Mock Management=====*/
@ -126,6 +129,9 @@ int main(void)
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_HeightWidthAgan, "test_calculate_mines_HeightWidthAgan", 370);
run_test(test_calculate_mines_HeightWidthRoundUp, "test_calculate_mines_HeightWidthRoundUp", 384);
run_test(test_calculate_mines_HeightWidthNoRound, "test_calculate_mines_HeightWidthNoRound", 398);
run_test(test_calculate_mines_HeightWidthFinal, "test_calculate_mines_HeightWidthFinal", 412);
return UnityEnd();
}

41
src/test/test_duellist_spielesammlung_projekt.c

@ -381,4 +381,45 @@ void test_calculate_mines_HeightWidthAgan(void)
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);
}
void test_calculate_mines_HeightWidthNoRound(void)
{
/* arrange */
int height = 9;
int width = 9;
int expected = 20;
/* act */
int result = calculate_mines(height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(expected, result);
}
void test_calculate_mines_HeightWidthFinal(void)
{
/* arrange */
int height = 7;
int width = 7;
int expected = 12;
/* act */
int result = calculate_mines(height, width);
/* assert */
TEST_ASSERT_EQUAL_INT(expected, result);
}
#endif // TEST
Loading…
Cancel
Save