aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-01-13 11:16:03 -0800
committerpx4dev <px4@purgatory.org>2013-01-13 11:16:03 -0800
commit58ea9fbf0145dfb4a84d6a6e074f3639355bf0bf (patch)
tree74c1dd8b6a80da6e53272e8afe08dd492a66b8ac /apps
parentdcb0a326481e56520d37bbcde18bb2129508d74f (diff)
parentca690f60272b5330f632cd18b58ee9af89fbc9ae (diff)
downloadpx4-firmware-58ea9fbf0145dfb4a84d6a6e074f3639355bf0bf.tar.gz
px4-firmware-58ea9fbf0145dfb4a84d6a6e074f3639355bf0bf.tar.bz2
px4-firmware-58ea9fbf0145dfb4a84d6a6e074f3639355bf0bf.zip
Merge pull request #154 from PX4/file_test_fix
Fixed #153 - when no microSD card is present, test used to hang, now abo...
Diffstat (limited to 'apps')
-rw-r--r--apps/px4/tests/tests_file.c8
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");