Browse Source

Wortspiel zu Menue hinzugefuegt

remotes/origin/mathespieledev
Lennart Goetze 11 months ago
parent
commit
059d59988f
  1. 2
      build/test/cache/defines_dependency.yml
  2. 59
      build/test/cache/test_bmi.c
  3. 1
      build/test/dependencies/bmi.d
  4. 4
      build/test/dependencies/test_bmi.d
  5. 3
      build/test/dependencies/test_bmi_runner.d
  6. BIN
      build/test/out/c/WortSpiel.o
  7. BIN
      build/test/out/c/bmi.o
  8. BIN
      build/test/out/c/test_bmi.o
  9. BIN
      build/test/out/c/test_bmi_runner.o
  10. BIN
      build/test/out/test_WortSpiel.out
  11. BIN
      build/test/out/test_bmi.out
  12. 59
      build/test/preprocess/files/test_bmi.c
  13. 3
      build/test/preprocess/includes/test_bmi.c
  14. 2
      build/test/results/test_SchereSteinPapier.pass
  15. 2
      build/test/results/test_WortSpiel.pass
  16. 2
      build/test/results/test_ageinseconds.pass
  17. 22
      build/test/results/test_bmi.pass
  18. 2
      build/test/results/test_minirechner.pass
  19. 2
      build/test/results/test_zahlenraten.pass
  20. 83
      build/test/runners/test_bmi_runner.c
  21. 7
      src/menue.c

2
build/test/cache/defines_dependency.yml

@ -9,3 +9,5 @@ src/SchereSteinPapier.c:
- TEST
src/WortSpiel.c:
- TEST
src/bmi.c:
- TEST

59
build/test/cache/test_bmi.c

@ -0,0 +1,59 @@
#include "src/bmi.h"
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_berechnung_BMI(void)
{
float result = calcBMI(2, 100);
float expected = 25;
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT);
}
void test_ausgabe_ergebnis(void)
{
const char *result = retResult(25);
char expected[] = "Normalgewicht";
UnityAssertEqualString((const char*)((expected)), (const char*)((result)), (
((void *)0)
), (UNITY_UINT)(26));
}

1
build/test/dependencies/bmi.d

@ -0,0 +1 @@
build/test/out/c/bmi.o: src/bmi.c src/bmi.h

4
build/test/dependencies/test_bmi.d

@ -0,0 +1,4 @@
build/test/out/c/test_bmi.o: test/test_bmi.c \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/bmi.h

3
build/test/dependencies/test_bmi_runner.d

@ -0,0 +1,3 @@
build/test/out/c/test_bmi_runner.o: build/test/runners/test_bmi_runner.c \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

BIN
build/test/out/c/WortSpiel.o

BIN
build/test/out/c/bmi.o

BIN
build/test/out/c/test_bmi.o

BIN
build/test/out/c/test_bmi_runner.o

BIN
build/test/out/test_WortSpiel.out

BIN
build/test/out/test_bmi.out

59
build/test/preprocess/files/test_bmi.c

@ -0,0 +1,59 @@
#include "src/bmi.h"
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_berechnung_BMI(void)
{
float result = calcBMI(2, 100);
float expected = 25;
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT);
}
void test_ausgabe_ergebnis(void)
{
const char *result = retResult(25);
char expected[] = "Normalgewicht";
UnityAssertEqualString((const char*)((expected)), (const char*)((result)), (
((void *)0)
), (UNITY_UINT)(26));
}

3
build/test/preprocess/includes/test_bmi.c

@ -0,0 +1,3 @@
---
- C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h
- src/bmi.h

2
build/test/results/test_SchereSteinPapier.pass

@ -19,4 +19,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.04579279999961727
:time: 0.05505930000072112

2
build/test/results/test_WortSpiel.pass

@ -59,4 +59,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.8378995999992185
:time: 0.5986981999994896

2
build/test/results/test_ageinseconds.pass

@ -23,4 +23,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.04312009999921429
:time: 0.050159799997345544

22
build/test/results/test_bmi.pass

@ -0,0 +1,22 @@
---
:source:
:path: test
:file: test_bmi.c
:successes:
- :test: test_berechnung_BMI
:line: 15
:message: ''
:unity_test_time: 0
- :test: test_ausgabe_ergebnis
:line: 22
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 2
:passed: 2
:failed: 0
:ignored: 0
:stdout: []
:time: 0.3213505999992776

2
build/test/results/test_minirechner.pass

@ -83,4 +83,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.04265739999937068
:time: 0.049012799998308765

2
build/test/results/test_zahlenraten.pass

@ -15,4 +15,4 @@
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0429972000001726
:time: 0.04845479999858071

83
build/test/runners/test_bmi_runner.c

@ -0,0 +1,83 @@
/* AUTOGENERATED FILE. DO NOT EDIT. */
/*=======Automagically Detected Files To Include=====*/
#include "unity.h"
int GlobalExpectCount;
int GlobalVerifyOrder;
char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/
extern void setUp(void);
extern void tearDown(void);
extern void test_berechnung_BMI(void);
extern void test_ausgabe_ergebnis(void);
/*=======Mock Management=====*/
static void CMock_Init(void)
{
GlobalExpectCount = 0;
GlobalVerifyOrder = 0;
GlobalOrderError = NULL;
}
static void CMock_Verify(void)
{
}
static void CMock_Destroy(void)
{
}
/*=======Test Reset Options=====*/
void resetTest(void);
void resetTest(void)
{
tearDown();
CMock_Verify();
CMock_Destroy();
CMock_Init();
setUp();
}
void verifyTest(void);
void verifyTest(void)
{
CMock_Verify();
}
/*=======Test Runner Used To Run Each Test=====*/
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
{
Unity.CurrentTestName = name;
Unity.CurrentTestLineNumber = line_num;
#ifdef UNITY_USE_COMMAND_LINE_ARGS
if (!UnityTestMatches())
return;
#endif
Unity.NumberOfTests++;
UNITY_CLR_DETAILS();
UNITY_EXEC_TIME_START();
CMock_Init();
if (TEST_PROTECT())
{
setUp();
func();
}
if (TEST_PROTECT())
{
tearDown();
CMock_Verify();
}
CMock_Destroy();
UNITY_EXEC_TIME_STOP();
UnityConcludeTest();
}
/*=======MAIN=====*/
int main(void)
{
UnityBegin("test_bmi.c");
run_test(test_berechnung_BMI, "test_berechnung_BMI", 15);
run_test(test_ausgabe_ergebnis, "test_ausgabe_ergebnis", 22);
return UnityEnd();
}

7
src/menue.c

@ -6,6 +6,7 @@ int run_magiceightball();
void run_zahlenraten();
int run_scheresteinpapier();
int run_bmi();
int run_wortspiel();
void trenner () {
// Die laenge der Abtrenner kann hier fuer alle 3 angepasst werden
@ -18,7 +19,7 @@ int main() {
while (eingabe != 0) {
trenner();
printf("\nWelches Programm wollen Sie starten?\n<1> Minirechner \n<2> AlterinSekunden\n<3> MagicEightBall\n<4> Zahlenraten\n<5> SchereSteinPapier\n<6> BMI-Rechner\nZum Abbrechen 0 eingeben.\n");
printf("\nWelches Programm wollen Sie starten?\n<1> Minirechner \n<2> AlterinSekunden\n<3> MagicEightBall\n<4> Zahlenraten\n<5> SchereSteinPapier\n<6> BMI-Rechner\n<7> Wortspiel\nZum Abbrechen 0 eingeben.\n");
trenner();
printf("\nEingabe: ");
scanf("%d", &eingabe);
@ -53,6 +54,10 @@ int main() {
case 6:
run_bmi();
case 7;
run_wortspiel();
break;
default:
printf("Bitte verwenden sie eine der gegebenen Ziffern");
}

Loading…
Cancel
Save