Added find_directory() test application. Unlike the other tests, it only

tests the libroot.so implementation, so it has to be run under Haiku to
test its implementation (it only prints out all directories, anyway).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10182 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-11-22 17:44:11 +00:00
parent 4cd43d200d
commit cd3931efde
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2004, François Revol.
* Distributed under the terms of the MIT license.
*/
#include <FindDirectory.h>
#include <fs_info.h>
#include <stdio.h>
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;
}
+4
View File
@@ -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