123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include <Arduino.h>
- #include "treppe.h"
-
- #include <unity.h>
-
- Treppe stairs(10);
-
- void setUp(void) {
- // run before each test
- // set stuff up here
- stairs.setup();
- Serial.println("Treppe initialized !");
- Serial.println("PCA9685 connected !");
- }
-
- void tearDown(void) {
- // clean stuff up here
- }
-
- void test_set_state(void) {
- stairs.setState(1);
- TEST_ASSERT_EQUAL(1, stairs.getState());
- stairs.setState(0);
- TEST_ASSERT_EQUAL(0, stairs.getState());
- }
-
-
- void test_set_direction(void) {
- stairs.setDirection(1);
- TEST_ASSERT_EQUAL(1, stairs.getDirection());
- stairs.setDirection(0);
- TEST_ASSERT_EQUAL(0, stairs.getDirection());
- }
-
- void setup()
- {
- delay(2000); // service delay
- UNITY_BEGIN();
-
- RUN_TEST(test_set_state);
- RUN_TEST(test_set_direction);
-
- UNITY_END(); // stop unit testing
- }
-
- void loop()
- {
- }
|