Browse Source

test example

tags/v0.2.0
Simon Schmidt 3 years ago
parent
commit
657f77e73d
1 changed files with 42 additions and 0 deletions
  1. 42
    0
      test/test_main.cpp

+ 42
- 0
test/test_main.cpp View File

@@ -0,0 +1,42 @@
#include <Arduino.h>
#include <unity.h>

String STR_TO_TEST;

void setUp(void) {
// set stuff up here
STR_TO_TEST = "Hello, world!";
}

void tearDown(void) {
// clean stuff up here
STR_TO_TEST = "";
}


void test_led_builtin_pin_number(void) {
TEST_ASSERT_EQUAL(2, LED_BUILTIN);
}


void test_string_concat(void) {
String hello = "Hello, ";
String world = "world!";
TEST_ASSERT_EQUAL_STRING(STR_TO_TEST.c_str(), (hello + world).c_str());
}


void setup()
{
delay(2000); // service delay
UNITY_BEGIN();

RUN_TEST(test_led_builtin_pin_number);
RUN_TEST(test_string_concat);

UNITY_END(); // stop unit testing
}

void loop()
{
}

Loading…
Cancel
Save