testing/fstest: add cleanup to fatutf8
@@ -60,7 +60,7 @@ int main(int argc, FAR char *argv[])
int len;
char buf[128];
- char path[256];
+ char path[PATH_MAX];
char *basepath = NULL;
@@ -166,5 +166,33 @@ int main(int argc, FAR char *argv[])
exit(fd);
}
+ printf("\n");
+
+ ret = remove(path);
+ if (ret == 0)
+ {
+ printf("removed %s\n", path);
+ basepath = strrchr(path, '/');
+ if (basepath != NULL)
+ {
+ *basepath = '\0';
+ ret = remove(path);
+ if (ret == 0)
+ {
+ printf("removed %s\n", path);
+ }
+ else
+ {
+ printf("remove failed: %d\n", errno);
+ exit(ret);
+ }
+ }
+ }
+ else
+ {
+ printf("remove failed: %d\n", errno);
+ exit(ret);
+ }
+
return EXIT_SUCCESS;
}
