You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
780 B
47 lines
780 B
#ifdef TEST
|
|
|
|
#include "unity.h"
|
|
|
|
#include "minirechner.h"
|
|
|
|
void setUp(void)
|
|
{
|
|
}
|
|
|
|
void tearDown(void)
|
|
{
|
|
}
|
|
|
|
// test addition
|
|
void test_minitaschenrechner_3_plus_4(void)
|
|
{
|
|
float result = addieren(3, 4);
|
|
TEST_ASSERT_EQUAL(7, result);
|
|
}
|
|
|
|
void test_minitaschenrechner_float_plus_float(void)
|
|
{
|
|
float result = addieren(3.1, 4.2);
|
|
TEST_ASSERT_EQUAL(7.3, result);
|
|
}
|
|
|
|
void test_minitaschenrechner_minus1_plus_minus3(void)
|
|
{
|
|
float result = addieren(-1, -3);
|
|
TEST_ASSERT_EQUAL(-4, result);
|
|
}
|
|
|
|
void test_minitaschenrechner_0_plus_2(void)
|
|
{
|
|
float result = addieren(0, 2);
|
|
TEST_ASSERT_EQUAL(2, result);
|
|
}
|
|
|
|
// test subtraktion
|
|
void test_minitaschenrechner_5_minus_2(void)
|
|
{
|
|
float result = subtrahieren(5, 2);
|
|
TEST_ASSERT_EQUAL(3, result);
|
|
}
|
|
|
|
#endif // TEST
|