minunit_test.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #include <stdio.h>
  2. #include "flipper.h"
  3. #include "log.h"
  4. #include "minunit_vars.h"
  5. #include "minunit.h"
  6. bool test_furi_ac_create_kill();
  7. bool test_furi_ac_switch_exit();
  8. bool test_furi_pipe_record();
  9. bool test_furi_holding_data();
  10. bool test_furi_concurrent_access();
  11. bool test_furi_nonexistent_data();
  12. bool test_furi_mute_algorithm();
  13. static int foo = 0;
  14. void test_setup(void) {
  15. foo = 7;
  16. }
  17. void test_teardown(void) {
  18. /* Nothing */
  19. }
  20. MU_TEST(test_check) {
  21. mu_check(foo != 6);
  22. }
  23. MU_TEST(mu_test_furi_ac_create_kill) {
  24. mu_assert_int_eq(test_furi_ac_create_kill(), true);
  25. }
  26. MU_TEST(mu_test_furi_ac_switch_exit) {
  27. mu_assert_int_eq(test_furi_ac_switch_exit(), true);
  28. }
  29. MU_TEST(mu_test_furi_pipe_record) {
  30. mu_assert_int_eq(test_furi_pipe_record(), true);
  31. }
  32. MU_TEST(mu_test_furi_holding_data) {
  33. mu_assert_int_eq(test_furi_holding_data(), true);
  34. }
  35. MU_TEST(mu_test_furi_concurrent_access) {
  36. mu_assert_int_eq(test_furi_concurrent_access(), true);
  37. }
  38. MU_TEST(mu_test_furi_nonexistent_data) {
  39. mu_assert_int_eq(test_furi_nonexistent_data(), true);
  40. }
  41. /*
  42. MU_TEST(mu_test_furi_mute_algorithm) {
  43. mu_assert_int_eq(test_furi_mute_algorithm(test_log), true);
  44. }
  45. */
  46. MU_TEST_SUITE(test_suite) {
  47. MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
  48. MU_RUN_TEST(test_check);
  49. MU_RUN_TEST(mu_test_furi_ac_create_kill);
  50. MU_RUN_TEST(mu_test_furi_ac_switch_exit);
  51. MU_RUN_TEST(mu_test_furi_pipe_record);
  52. MU_RUN_TEST(mu_test_furi_holding_data);
  53. MU_RUN_TEST(mu_test_furi_concurrent_access);
  54. MU_RUN_TEST(mu_test_furi_nonexistent_data);
  55. // MU_RUN_TEST(mu_test_furi_mute_algorithm);
  56. }
  57. int run_minunit() {
  58. MU_RUN_SUITE(test_suite);
  59. MU_REPORT();
  60. return MU_EXIT_CODE;
  61. }