projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the default simulator qemu for project 2...4,
[pintos-anon]
/
src
/
tests
/
filesys
/
extended
/
dir-lsdir.c
diff --git
a/src/tests/filesys/extended/dir-lsdir.c
b/src/tests/filesys/extended/dir-lsdir.c
index 1896de32d884b07628331e2918e570ce7f90cb32..254e59501b504f2dfb7c7d08eb1ca67ccf41d7ee 100644
(file)
--- a/
src/tests/filesys/extended/dir-lsdir.c
+++ b/
src/tests/filesys/extended/dir-lsdir.c
@@
-1,3
+1,5
@@
+/* Lists the contents of a directory using readdir. */
+
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
@@
-5,5
+7,15
@@
void
test_main (void)
{
void
test_main (void)
{
- lsdir ();
+ int fd;
+ char name[READDIR_MAX_LEN + 1];
+
+ CHECK ((fd = open (".")) > 1, "open .");
+ CHECK (isdir (fd), "isdir(.)");
+
+ while (readdir (fd, name))
+ msg ("readdir: \"%s\"", name);
+
+ msg ("close .");
+ close (fd);
}
}