diff --git a/src/tests/kernel/libroot/os/FindDirectoryTest.cpp b/src/tests/kernel/libroot/os/FindDirectoryTest.cpp new file mode 100644 index 0000000000..793f05cdf7 --- /dev/null +++ b/src/tests/kernel/libroot/os/FindDirectoryTest.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2004, François Revol. + * Distributed under the terms of the MIT license. + */ + + +#include +#include + +#include + + +int +main(int argc, char **argv) +{ + dev_t dev = -1; + + if (argc > 1) + dev = dev_for_path(argv[1]); + + for (int32 i = B_DESKTOP_DIRECTORY; i < B_UTILITIES_DIRECTORY; i++) { + char buffer[B_PATH_NAME_LENGTH]; + status_t err = find_directory((directory_which)i, dev, false, buffer, B_PATH_NAME_LENGTH); + if (err) + continue; + + printf("dir[%04ld] = '%s'\n", i, buffer); + } + return 0; +} + diff --git a/src/tests/kernel/libroot/os/Jamfile b/src/tests/kernel/libroot/os/Jamfile index 0bb1e42836..67f3f8d9c4 100644 --- a/src/tests/kernel/libroot/os/Jamfile +++ b/src/tests/kernel/libroot/os/Jamfile @@ -9,6 +9,10 @@ SimpleTest ParseDateTest : ParseDateTest.cpp parsedate.cpp ; +SimpleTest FindDirectoryTest + : FindDirectoryTest.cpp + ; + # Tell Jam where to find these sources SEARCH on [ FGristFiles driver_settings.c