meta: re-organise tests
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#include <fx/io/directory.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define NRAND_NUMBERS 12
|
||||
#define NRAND_BYTES 128
|
||||
#define NRAND_DOUBLES 8
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
fx_directory *dir = NULL;
|
||||
fx_path *path = fx_path_create_from_cstr(argv[1]);
|
||||
fx_result result = fx_directory_open(FX_DIRECTORY_ROOT, path, 0, &dir);
|
||||
|
||||
if (fx_result_is_error(result)) {
|
||||
fx_throw(result);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fx_iterator *it = fx_directory_begin(dir, FX_DIRECTORY_ITERATE_PARENT_FIRST);
|
||||
fx_foreach(fx_directory_entry *, entry, it)
|
||||
{
|
||||
printf("%s\n", fx_path_ptr(entry->filepath));
|
||||
}
|
||||
|
||||
fx_iterator_unref(it);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user