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.

31 lines
436B

  1. #include "asserts.h"
  2. #include "Divider.h"
  3. static void testDiv0()
  4. {
  5. bool called = false;
  6. auto lambda = [&]() {
  7. called = true;
  8. };
  9. Divider d;
  10. d.setup(3, lambda);
  11. assert(!called);
  12. // fires on first call
  13. d.step();
  14. assert(called);
  15. called = false;
  16. d.step();
  17. assert(!called);
  18. d.step();
  19. assert(!called);
  20. d.step();
  21. assert(called);
  22. }
  23. void testUtils()
  24. {
  25. testDiv0();
  26. }