test_index.c 2.0 KB

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