Browse Source

Unittest setup für Spiellogik

main
Jannis 2 years ago
parent
commit
d99a1f5ba0
  1. 2
      build/test/cache/defines_dependency.yml
  2. 35
      build/test/cache/test_Spiellogik.c
  3. 1
      build/test/dependencies/Spiellogik.d
  4. 4
      build/test/dependencies/test_Spiellogik.d
  5. 4
      build/test/dependencies/test_Spiellogik_runner.d
  6. BIN
      build/test/out/c/Spiellogik.o
  7. BIN
      build/test/out/c/probe.o
  8. BIN
      build/test/out/c/test_Spiellogik.o
  9. BIN
      build/test/out/c/test_Spiellogik_runner.o
  10. BIN
      build/test/out/c/test_test.o
  11. BIN
      build/test/out/test_Spiellogik.out
  12. BIN
      build/test/out/test_test.out
  13. 35
      build/test/preprocess/files/test_Spiellogik.c
  14. 3
      build/test/preprocess/includes/test_Spiellogik.c
  15. 18
      build/test/results/test_Spiellogik.pass
  16. 2
      build/test/results/test_test.pass
  17. 81
      build/test/runners/test_Spiellogik_runner.c
  18. 4
      src/Spiellogik.c
  19. 8
      src/Spiellogik.h
  20. 17
      test/test_Spiellogik.c

2
build/test/cache/defines_dependency.yml

@ -3,3 +3,5 @@ src/test.c:
- TEST - TEST
src/probe.c: src/probe.c:
- TEST - TEST
src/Spiellogik.c:
- TEST

35
build/test/cache/test_Spiellogik.c

@ -0,0 +1,35 @@
#include "src/Spiellogik.h"
#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_test1(void){
int result = probe(2);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(16), UNITY_DISPLAY_STYLE_INT);
}

1
build/test/dependencies/Spiellogik.d

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

4
build/test/dependencies/test_Spiellogik.d

@ -0,0 +1,4 @@
build/test/out/c/test_Spiellogik.o: test/test_Spiellogik.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 \
src/Spiellogik.h

4
build/test/dependencies/test_Spiellogik_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_Spiellogik_runner.o: \
build/test/runners/test_Spiellogik_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

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

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

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

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

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

BIN
build/test/out/test_Spiellogik.out

BIN
build/test/out/test_test.out

35
build/test/preprocess/files/test_Spiellogik.c

@ -0,0 +1,35 @@
#include "src/Spiellogik.h"
#include "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void){
}
void tearDown(void){
}
void test_test1(void){
int result = probe(2);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(16), UNITY_DISPLAY_STYLE_INT);
}

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

@ -0,0 +1,3 @@
---
- "/var/lib/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
- src/Spiellogik.h

18
build/test/results/test_Spiellogik.pass

@ -0,0 +1,18 @@
---
:source:
:path: test
:file: test_Spiellogik.c
:successes:
- :test: test_test1
:line: 12
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout: []
:time: 0.0014955760002521856

2
build/test/results/test_test.pass

@ -15,4 +15,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.0012681320004048757
:time: 0.0015436290000252484

81
build/test/runners/test_Spiellogik_runner.c

@ -0,0 +1,81 @@
/* 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_test1(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_Spiellogik.c");
run_test(test_test1, "test_test1", 12);
return UnityEnd();
}

4
src/Spiellogik.c

@ -67,3 +67,7 @@ int lose(int realU[N][N], char richtung){
} }
return 0; return 0;
} }
int probe(int input){
return input;
}

8
src/Spiellogik.h

@ -0,0 +1,8 @@
#include "unity.h"
#ifndef PROBE_H
#define PROBE_H
int probe(int input);
#endif

17
test/test_Spiellogik.c

@ -0,0 +1,17 @@
#include "unity.h"
#include "Spiellogik.h"
#include <stdlib.h>
void setUp(void){
}
void tearDown(void){
}
void test_test1(void){
int result = probe(2);
TEST_ASSERT_EQUAL_INT(2, result);
}
Loading…
Cancel
Save