furi_test.c 1018 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <stdio.h>
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include "../minunit.h"
  5. // v2 tests
  6. void test_furi_create_open();
  7. void test_furi_concurrent_access();
  8. void test_furi_pubsub();
  9. void test_furi_memmgr();
  10. static int foo = 0;
  11. void test_setup(void) {
  12. foo = 7;
  13. }
  14. void test_teardown(void) {
  15. /* Nothing */
  16. }
  17. MU_TEST(test_check) {
  18. mu_check(foo != 6);
  19. }
  20. // v2 tests
  21. MU_TEST(mu_test_furi_create_open) {
  22. test_furi_create_open();
  23. }
  24. MU_TEST(mu_test_furi_pubsub) {
  25. test_furi_pubsub();
  26. }
  27. MU_TEST(mu_test_furi_memmgr) {
  28. // this test is not accurate, but gives a basic understanding
  29. // that memory management is working fine
  30. test_furi_memmgr();
  31. }
  32. MU_TEST_SUITE(test_suite) {
  33. MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
  34. MU_RUN_TEST(test_check);
  35. // v2 tests
  36. MU_RUN_TEST(mu_test_furi_create_open);
  37. MU_RUN_TEST(mu_test_furi_pubsub);
  38. MU_RUN_TEST(mu_test_furi_memmgr);
  39. }
  40. int run_minunit_test_furi() {
  41. MU_RUN_SUITE(test_suite);
  42. return MU_EXIT_CODE;
  43. }