Browse Source

addition funktion minirechner inkl. unittest

remotes/origin/minirechnerdev
fdai7754 11 months ago
parent
commit
9e1bef93f1
  1. 6
      src/minirechner.c
  2. 1
      src/minirechner.h
  3. 6
      test/test_minirechner.c

6
src/minirechner.c

@ -1 +1,7 @@
#include <stdio.h>
#include "minirechner.h" #include "minirechner.h"
//addieren
float addieren(float a, float b) {
return a + b;
}

1
src/minirechner.h

@ -1,5 +1,6 @@
#ifndef MINIRECHNER_H #ifndef MINIRECHNER_H
#define MINIRECHNER_H #define MINIRECHNER_H
float addieren(float a, float b);
#endif // MINIRECHNER_H #endif // MINIRECHNER_H

6
test/test_minirechner.c

@ -12,9 +12,11 @@ void tearDown(void)
{ {
} }
void test_minirechner_NeedToImplement(void)
// test addition
void test_minitaschenrechner_3_plus_4(void)
{ {
TEST_IGNORE_MESSAGE("Need to Implement minirechner");
float result = addieren(3, 4);
TEST_ASSERT_EQUAL(7, result);
} }
#endif // TEST #endif // TEST
Loading…
Cancel
Save