Browse Source

test_trapezFlaeche

main
Celal Kir 2 years ago
parent
commit
ece3f961d1
  1. 43
      build/test/cache/test_trapezFlaeche.c
  2. 4
      build/test/dependencies/test_trapezFlaeche.d
  3. 4
      build/test/dependencies/test_trapezFlaeche_runner.d
  4. BIN
      build/test/out/c/funktion.o
  5. BIN
      build/test/out/c/test_trapezFlaeche.o
  6. BIN
      build/test/out/c/test_trapezFlaeche_runner.o
  7. BIN
      build/test/out/test_trapezFlaeche.out
  8. 43
      build/test/preprocess/files/test_trapezFlaeche.c
  9. 3
      build/test/preprocess/includes/test_trapezFlaeche.c
  10. 20
      build/test/results/test_trapezFlaeche.pass
  11. 81
      build/test/runners/test_trapezFlaeche_runner.c
  12. 8
      src/.idea/.gitignore
  13. 8
      src/.idea/modules.xml
  14. 8
      src/.idea/src.iml
  15. 6
      src/.idea/vcs.xml
  16. 13
      src/funktion.c
  17. 2
      src/funktion.h
  18. 21
      test/test_trapezFlaeche.c

43
build/test/cache/test_trapezFlaeche.c

@ -0,0 +1,43 @@
#include "src/funktion.h"
#include "C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_trapezFlaeche_calculates_correct_area(void) {
double a = 6.0;
double b = 8.0;
double h = 3.0;
double result = trapezFlaeche(a,b,h);
double ergebnis = 21;
printf("Testergebniss %f", ergebnis);
UnityAssertFloatsWithin((UNITY_FLOAT)((UNITY_FLOAT)((result)) * (UNITY_FLOAT)(0.00001f)), (UNITY_FLOAT)((UNITY_FLOAT)((result))), (UNITY_FLOAT)((UNITY_FLOAT)((ergebnis))), ((
((void *)0)
)), (UNITY_UINT)((UNITY_UINT)(20)));
}

4
build/test/dependencies/test_trapezFlaeche.d

@ -0,0 +1,4 @@
build/test/out/c/test_trapezFlaeche.o: test/test_trapezFlaeche.c \
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \
src/funktion.h

4
build/test/dependencies/test_trapezFlaeche_runner.d

@ -0,0 +1,4 @@
build/test/out/c/test_trapezFlaeche_runner.o: \
build/test/runners/test_trapezFlaeche_runner.c \
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h

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

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

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

BIN
build/test/out/test_trapezFlaeche.out

43
build/test/preprocess/files/test_trapezFlaeche.c

@ -0,0 +1,43 @@
#include "src/funktion.h"
#include "C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_trapezFlaeche_calculates_correct_area(void) {
double a = 6.0;
double b = 8.0;
double h = 3.0;
double result = trapezFlaeche(a,b,h);
double ergebnis = 21;
printf("Testergebniss %f", ergebnis);
UnityAssertFloatsWithin((UNITY_FLOAT)((UNITY_FLOAT)((result)) * (UNITY_FLOAT)(0.00001f)), (UNITY_FLOAT)((UNITY_FLOAT)((result))), (UNITY_FLOAT)((UNITY_FLOAT)((ergebnis))), ((
((void *)0)
)), (UNITY_UINT)((UNITY_UINT)(20)));
}

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

@ -0,0 +1,3 @@
---
- C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h
- src/funktion.h

20
build/test/results/test_trapezFlaeche.pass

@ -0,0 +1,20 @@
---
:source:
:path: test
:file: test_trapezFlaeche.c
:successes:
- :test: test_trapezFlaeche_calculates_correct_area
:line: 13
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 1
:passed: 1
:failed: 0
:ignored: 0
:stdout:
- 'Flaeche vom Trapez beträgt: 21.000000'
- Testergebniss 21.000000
:time: 0.46227359998738393

81
build/test/runners/test_trapezFlaeche_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_trapezFlaeche_calculates_correct_area(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_trapezFlaeche.c");
run_test(test_trapezFlaeche_calculates_correct_area, "test_trapezFlaeche_calculates_correct_area", 13);
return UnityEnd();
}

8
src/.idea/.gitignore

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
src/.idea/modules.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/src.iml" filepath="$PROJECT_DIR$/.idea/src.iml" />
</modules>
</component>
</project>

8
src/.idea/src.iml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
src/.idea/vcs.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

13
src/funktion.c

@ -9,13 +9,6 @@ float getValue(char c) {
printf("%c eingeben: ",c); printf("%c eingeben: ",c);
scanf("%f", &value); scanf("%f", &value);
return value; return value;
double trapezFlaeche(double a, double b, double h) {
printf("Flaeche vom Trapez beträgt: %f\n",(a + b) * h / 2);
double result=(a + b) * h / 2;
return result;
}
} }
double marktanteil(double gesamtumsatz,double unternehmensumsatz) { double marktanteil(double gesamtumsatz,double unternehmensumsatz) {
return unternehmensumsatz / gesamtumsatz * 100.0; return unternehmensumsatz / gesamtumsatz * 100.0;
@ -119,3 +112,9 @@ double GewinnMaximum(double p,double q,double tc,double tr){
float gewinnmaximumm = erloesfunktion - tc - tr; float gewinnmaximumm = erloesfunktion - tc - tr;
return gewinnmaximumm; return gewinnmaximumm;
} }
double trapezFlaeche(double a, double b, double h) {
printf("Flaeche vom Trapez beträgt: %f\n",(a + b) * h / 2);
double result=(a + b) * h / 2;
return result;
}

2
src/funktion.h

@ -2,7 +2,7 @@
#define FUNKTION_H #define FUNKTION_H
float getValue(char c); float getValue(char c);
double trapezFlaeche(double a, double b, double h);
double trapezFlaeche(double a,double b,double h);
double marktanteil(double gesamtumsatz,double unternehmensumsatz); double marktanteil(double gesamtumsatz,double unternehmensumsatz);
double angebotserfolg(double angeboteneMenge,double verkaufteMenge); double angebotserfolg(double angeboteneMenge,double verkaufteMenge);
double Anlagenabnutzungsgrad(double anfangsbuchwert,double restbuchwert); double Anlagenabnutzungsgrad(double anfangsbuchwert,double restbuchwert);

21
test/test_trapezFlaeche.c

@ -0,0 +1,21 @@
#include "unity.h"
#include "funktion.h"
void setUp(void)
{
}
void tearDown(void)
{
}
void test_trapezFlaeche_calculates_correct_area(void) {
double a = 6.0;
double b = 8.0;
double h = 3.0;
double result = trapezFlaeche(a,b,h);
double ergebnis = 21;
printf("Testergebniss %f", ergebnis);
TEST_ASSERT_EQUAL_FLOAT(result, ergebnis);
}
Loading…
Cancel
Save