Browse Source

merge commit 2

main
Christian Reum 11 months ago
parent
commit
c8d3af1839
  1. 4
      build/test/cache/defines_dependency.yml
  2. 22
      build/test/cache/input.yml
  3. 89
      build/test/cache/test_wwm.c
  4. 10
      build/test/dependencies/cmock.d
  5. 0
      build/test/dependencies/force_build
  6. 4
      build/test/dependencies/test_casualQuiz_runner.d
  7. 4
      build/test/dependencies/test_quizduell_runner.d
  8. 4
      build/test/dependencies/test_timequiz_runner.d
  9. 5
      build/test/dependencies/test_wwm.d
  10. 4
      build/test/dependencies/test_wwm_runner.d
  11. 6
      build/test/dependencies/unity.d
  12. 1
      build/test/dependencies/wwm.d
  13. BIN
      build/test/out/c/cmock.o
  14. BIN
      build/test/out/c/test_casualQuiz.o
  15. BIN
      build/test/out/c/test_casualQuiz_runner.o
  16. BIN
      build/test/out/c/test_quizduell.o
  17. BIN
      build/test/out/c/test_quizduell_runner.o
  18. BIN
      build/test/out/c/test_timequiz.o
  19. BIN
      build/test/out/c/test_timequiz_runner.o
  20. BIN
      build/test/out/c/test_wwm.o
  21. BIN
      build/test/out/c/test_wwm_runner.o
  22. BIN
      build/test/out/c/unity.o
  23. BIN
      build/test/out/c/wwm.o
  24. BIN
      build/test/out/test_casualQuiz.out
  25. BIN
      build/test/out/test_quizduell.out
  26. BIN
      build/test/out/test_timequiz.out
  27. BIN
      build/test/out/test_wwm.out
  28. 89
      build/test/preprocess/files/test_wwm.c
  29. 4
      build/test/preprocess/includes/test_wwm.c
  30. 2
      build/test/results/test_casualQuiz.pass
  31. 2
      build/test/results/test_quizduell.pass
  32. 2
      build/test/results/test_timequiz.pass
  33. 20
      build/test/results/test_wwm.pass
  34. 40
      build/test/runners/test_wwm_runner.c

4
build/test/cache/defines_dependency.yml

@ -1 +1,3 @@
--- {}
---
src/wwm.c:
- TEST

22
build/test/cache/input.yml

@ -77,10 +77,10 @@
:testfail: ".fail" :testfail: ".fail"
:dependencies: ".d" :dependencies: ".d"
:unity: :unity:
:vendor_path: "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor"
:vendor_path: C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor
:defines: [] :defines: []
:cmock: :cmock:
:vendor_path: "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor"
:vendor_path: C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor
:defines: [] :defines: []
:includes: [] :includes: []
:mock_prefix: mock_ :mock_prefix: mock_
@ -99,14 +99,14 @@
:verbosity: 3 :verbosity: 3
:unity_helper: false :unity_helper: false
:cexception: :cexception:
:vendor_path: "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor"
:vendor_path: C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor
:defines: [] :defines: []
:test_runner: :test_runner:
:includes: [] :includes: []
:file_suffix: _runner :file_suffix: _runner
:tools: :tools:
:test_compiler: :test_compiler:
:executable: gcc
:executable: gcc.exe
:name: default_test_compiler :name: default_test_compiler
:stderr_redirect: :none :stderr_redirect: :none
:background_exec: :none :background_exec: :none
@ -132,7 +132,7 @@
:optional: false :optional: false
:arguments: [] :arguments: []
:test_linker: :test_linker:
:executable: gcc
:executable: gcc.exe
:name: default_test_linker :name: default_test_linker
:stderr_redirect: :none :stderr_redirect: :none
:background_exec: :none :background_exec: :none
@ -148,7 +148,7 @@
- "${4}" - "${4}"
- '' - ''
:test_file_preprocessor: :test_file_preprocessor:
:executable: gcc
:executable: gcc.exe
:name: default_test_file_preprocessor :name: default_test_file_preprocessor
:stderr_redirect: :none :stderr_redirect: :none
:background_exec: :none :background_exec: :none
@ -165,7 +165,7 @@
- '"${1}"' - '"${1}"'
- -o "${2}" - -o "${2}"
:test_file_preprocessor_directives: :test_file_preprocessor_directives:
:executable: gcc
:executable: gcc.exe
:name: default_test_file_preprocessor_directives :name: default_test_file_preprocessor_directives
:stderr_redirect: :none :stderr_redirect: :none
:background_exec: :none :background_exec: :none
@ -181,7 +181,7 @@
- '"${1}"' - '"${1}"'
- -o "${2}" - -o "${2}"
:test_includes_preprocessor: :test_includes_preprocessor:
:executable: gcc
:executable: gcc.exe
:name: default_test_includes_preprocessor :name: default_test_includes_preprocessor
:stderr_redirect: :none :stderr_redirect: :none
:background_exec: :none :background_exec: :none
@ -223,13 +223,13 @@
:arguments: [] :arguments: []
:plugins: :plugins:
:load_paths: :load_paths:
- "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/lib/../plugins"
- C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/lib/../plugins
:enabled: :enabled:
- stdout_pretty_tests_report - stdout_pretty_tests_report
- module_generator - module_generator
:display_raw_test_results: false :display_raw_test_results: false
:stdout_pretty_tests_report_path: "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/lib/../plugins/stdout_pretty_tests_report"
:module_generator_path: "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/lib/../plugins/module_generator"
:stdout_pretty_tests_report_path: C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/lib/../plugins/stdout_pretty_tests_report
:module_generator_path: C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/lib/../plugins/module_generator
:gcov: :gcov:
:reports: :reports:
- HtmlDetailed - HtmlDetailed

89
build/test/cache/test_wwm.c

@ -0,0 +1,89 @@
#include "src/wwm.h"
#include "C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void) {
}
void tearDown(void) {
}
void test_setGeld_1(void) {
runde = 0;
geld = 0;
frage = 0;
useranswer = 0;
UnityAssertEqualNumber((UNITY_INT)((100)), (UNITY_INT)((setGeld(1))), (
((void *)0)
), (UNITY_UINT)(22), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((100)), (UNITY_INT)((geld)), (
((void *)0)
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT);
}
void test_setGeld_2(void) {
runde = 0;
UnityAssertEqualNumber((UNITY_INT)((300)), (UNITY_INT)((setGeld(3))), (
((void *)0)
), (UNITY_UINT)(31), UNITY_DISPLAY_STYLE_INT);
}
void test_crandomNumber(void){
int result = crandomNumber();
do {if ((result >= 0 && result <= 9)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(38)));}} while(0);
}

10
build/test/dependencies/cmock.d

@ -1,6 +1,6 @@
build/test/out/c/cmock.o: \ build/test/out/c/cmock.o: \
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.c \
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.h \
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock_internals.h \
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h
C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.c \
C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock.h \
C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/cmock/src/cmock_internals.h \
C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

0
build/test/dependencies/force_build

4
build/test/dependencies/test_casualQuiz_runner.d

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

4
build/test/dependencies/test_quizduell_runner.d

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

4
build/test/dependencies/test_timequiz_runner.d

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

5
build/test/dependencies/test_wwm.d

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

4
build/test/dependencies/test_wwm_runner.d

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

6
build/test/dependencies/unity.d

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

1
build/test/dependencies/wwm.d

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

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

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

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

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

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

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

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

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

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

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

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

BIN
build/test/out/test_casualQuiz.out

BIN
build/test/out/test_quizduell.out

BIN
build/test/out/test_timequiz.out

BIN
build/test/out/test_wwm.out

89
build/test/preprocess/files/test_wwm.c

@ -0,0 +1,89 @@
#include "src/wwm.h"
#include "C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void) {
}
void tearDown(void) {
}
void test_setGeld_1(void) {
runde = 0;
geld = 0;
frage = 0;
useranswer = 0;
UnityAssertEqualNumber((UNITY_INT)((100)), (UNITY_INT)((setGeld(1))), (
((void *)0)
), (UNITY_UINT)(22), UNITY_DISPLAY_STYLE_INT);
UnityAssertEqualNumber((UNITY_INT)((100)), (UNITY_INT)((geld)), (
((void *)0)
), (UNITY_UINT)(23), UNITY_DISPLAY_STYLE_INT);
}
void test_setGeld_2(void) {
runde = 0;
UnityAssertEqualNumber((UNITY_INT)((300)), (UNITY_INT)((setGeld(3))), (
((void *)0)
), (UNITY_UINT)(31), UNITY_DISPLAY_STYLE_INT);
}
void test_crandomNumber(void){
int result = crandomNumber();
do {if ((result >= 0 && result <= 9)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(38)));}} while(0);
}

4
build/test/preprocess/includes/test_wwm.c

@ -1 +1,3 @@
--- []
---
- C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h
- src/wwm.h

2
build/test/results/test_casualQuiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.004336156009230763
:time: 0.09232900000642985

2
build/test/results/test_quizduell.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.004334530996857211
:time: 0.07104519999120384

2
build/test/results/test_timequiz.pass

@ -11,4 +11,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.0043847519846167415
:time: 0.06864710000809282

20
build/test/results/test_wwm.pass

@ -2,13 +2,25 @@
:source: :source:
:path: test :path: test
:file: test_wwm.c :file: test_wwm.c
:successes: []
:successes:
- :test: test_setGeld_1
:line: 14
:message: ''
:unity_test_time: 0
- :test: test_setGeld_2
:line: 27
:message: ''
:unity_test_time: 0
- :test: test_crandomNumber
:line: 36
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 0
:passed: 0
:total: 3
:passed: 3
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.004366140026831999
:time: 0.46659269998781383

40
build/test/runners/test_wwm_runner.c

@ -10,6 +10,9 @@ char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/ /*=======External Functions This Runner Calls=====*/
extern void setUp(void); extern void setUp(void);
extern void tearDown(void); extern void tearDown(void);
extern void test_setGeld_1(void);
extern void test_setGeld_2(void);
extern void test_crandomNumber(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -26,12 +29,6 @@ static void CMock_Destroy(void)
{ {
} }
/*=======Setup (stub)=====*/
void setUp(void) {}
/*=======Teardown (stub)=====*/
void tearDown(void) {}
/*=======Test Reset Options=====*/ /*=======Test Reset Options=====*/
void resetTest(void); void resetTest(void);
void resetTest(void) void resetTest(void)
@ -48,10 +45,41 @@ void verifyTest(void)
CMock_Verify(); 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=====*/ /*=======MAIN=====*/
int main(void) int main(void)
{ {
UnityBegin("test_wwm.c"); UnityBegin("test_wwm.c");
run_test(test_setGeld_1, "test_setGeld_1", 14);
run_test(test_setGeld_2, "test_setGeld_2", 27);
run_test(test_crandomNumber, "test_crandomNumber", 36);
return UnityEnd(); return UnityEnd();
} }
Loading…
Cancel
Save