test_index.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #include <stdio.h>
  2. #include "flipper.h"
  3. #include "log.h"
  4. #include "flipper-core.h"
  5. bool test_furi_ac_create_kill(FuriRecordSubscriber* log);
  6. bool test_furi_ac_switch_exit(FuriRecordSubscriber* log);
  7. bool test_furi_pipe_record(FuriRecordSubscriber* log);
  8. bool test_furi_holding_data(FuriRecordSubscriber* log);
  9. bool test_furi_concurrent_access(FuriRecordSubscriber* log);
  10. bool test_furi_nonexistent_data(FuriRecordSubscriber* log);
  11. bool test_furi_mute_algorithm(FuriRecordSubscriber* log);
  12. void flipper_test_app(void* p) {
  13. FuriRecordSubscriber* log = get_default_log();
  14. if(test_furi_ac_create_kill(log)) {
  15. fuprintf(log, "[TEST] test_furi_ac_create_kill PASSED\n");
  16. } else {
  17. fuprintf(log, "[TEST] test_furi_ac_create_kill FAILED\n");
  18. }
  19. if(test_furi_ac_switch_exit(log)) {
  20. fuprintf(log, "[TEST] test_furi_ac_switch_exit PASSED\n");
  21. } else {
  22. fuprintf(log, "[TEST] test_furi_ac_switch_exit FAILED\n");
  23. }
  24. if(test_furi_pipe_record(log)) {
  25. fuprintf(log, "[TEST] test_furi_pipe_record PASSED\n");
  26. } else {
  27. fuprintf(log, "[TEST] test_furi_pipe_record FAILED\n");
  28. }
  29. if(test_furi_holding_data(log)) {
  30. fuprintf(log, "[TEST] test_furi_holding_data PASSED\n");
  31. } else {
  32. fuprintf(log, "[TEST] test_furi_holding_data FAILED\n");
  33. }
  34. if(test_furi_concurrent_access(log)) {
  35. fuprintf(log, "[TEST] test_furi_concurrent_access PASSED\n");
  36. } else {
  37. fuprintf(log, "[TEST] test_furi_concurrent_access FAILED\n");
  38. }
  39. if(test_furi_nonexistent_data(log)) {
  40. fuprintf(log, "[TEST] test_furi_nonexistent_data PASSED\n");
  41. } else {
  42. fuprintf(log, "[TEST] test_furi_nonexistent_data FAILED\n");
  43. }
  44. if(test_furi_mute_algorithm(log)) {
  45. fuprintf(log, "[TEST] test_furi_mute_algorithm PASSED\n");
  46. } else {
  47. fuprintf(log, "[TEST] test_furi_mute_algorithm FAILED\n");
  48. }
  49. if(add(1, 2) == 3) {
  50. fuprintf(log, "[TEST] Rust add PASSED\n");
  51. } else {
  52. fuprintf(log, "[TEST] Rust add FAILED\n");
  53. }
  54. furiac_exit(NULL);
  55. }