ESP8266 Treppenlichtsteuerung mit OTA zum Firmware Upload
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.

test_pwm.cpp 844B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // #include <Arduino.h>
  2. #include "treppe.h"
  3. #include <unity.h>
  4. Treppe stairs(10);
  5. void setUp(void) {
  6. // run before each test
  7. // set stuff up here
  8. stairs.setup();
  9. Serial.println("Treppe initialized !");
  10. Serial.println("PCA9685 connected !");
  11. }
  12. void tearDown(void) {
  13. // clean stuff up here
  14. }
  15. void test_set_state(void) {
  16. stairs.setState(1);
  17. TEST_ASSERT_EQUAL(1, stairs.getState());
  18. stairs.setState(0);
  19. TEST_ASSERT_EQUAL(0, stairs.getState());
  20. }
  21. void test_set_direction(void) {
  22. stairs.setDirection(1);
  23. TEST_ASSERT_EQUAL(1, stairs.getDirection());
  24. stairs.setDirection(0);
  25. TEST_ASSERT_EQUAL(0, stairs.getDirection());
  26. }
  27. void setup()
  28. {
  29. delay(2000); // service delay
  30. UNITY_BEGIN();
  31. RUN_TEST(test_set_state);
  32. RUN_TEST(test_set_direction);
  33. UNITY_END(); // stop unit testing
  34. }
  35. void loop()
  36. {
  37. }