diff options
-rw-r--r-- | apps/px4/tests/tests_file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/px4/tests/tests_file.c b/apps/px4/tests/tests_file.c index 697410cee..6f75b9812 100644 --- a/apps/px4/tests/tests_file.c +++ b/apps/px4/tests/tests_file.c @@ -37,6 +37,7 @@ * File write test. */ +#include <sys/stat.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> @@ -51,6 +52,13 @@ int test_file(int argc, char *argv[]) { + /* check if microSD card is mounted */ + struct stat buffer; + if (stat("/fs/microsd/", &buffer)) { + warnx("no microSD card mounted, aborting file test"); + return 1; + } + uint8_t buf[512]; hrt_abstime start, end; perf_counter_t wperf = perf_alloc(PC_ELAPSED, "SD writes"); |