|
|
|
|
|
|
|
|
|
|
|
#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() |
|
|
|
|
|
{ |
|
|
|
|
|
} |