Lines Matching defs:file
5 // This file is distributed under the University of Illinois Open Source
20 // Used to create a fake file system for running the tests with such
22 // file system on the machine running the tests.
25 // Maps a file/directory path to its desired stat result. Anything
26 // not in this map is considered to not exist in the file system.
39 // Inject a file with the given inode value to the fake file system.
44 // Inject a directory with the given inode value to the fake file system.
57 return CacheMissing; // This means the file/directory doesn't exist.
71 // When a virtual file is added, its getDir() field is set correctly
74 const FileEntry *file = manager.getVirtualFile("foo.cpp", 42, 0);
75 ASSERT_TRUE(file != NULL);
77 const DirectoryEntry *dir = file->getDir();
81 file = manager.getVirtualFile("x/y/z.cpp", 42, 0);
82 ASSERT_TRUE(file != NULL);
84 dir = file->getDir();
89 // Before any virtual file is added, no virtual directory exists.
92 // FileManager to report "file/directory doesn't exist". This
94 // by what's in the real file system.
102 // When a virtual file is added, all of its ancestors should be created.
104 // Fake an empty real file system.
119 // getFile() returns non-NULL if a real file exists at the given path.
121 // Inject fake files into the file system.
135 const FileEntry *file = manager.getFile("/tmp/test");
136 ASSERT_TRUE(file != NULL);
137 EXPECT_STREQ("/tmp/test", file->getName());
139 const DirectoryEntry *dir = file->getDir();
144 file = manager.getFile(FileName);
145 ASSERT_TRUE(file != NULL);
147 dir = file->getDir();
153 // getFile() returns non-NULL if a virtual file exists at the given path.
155 // Fake an empty real file system.
159 const FileEntry *file = manager.getFile("virtual/dir/bar.h");
160 ASSERT_TRUE(file != NULL);
161 EXPECT_STREQ("virtual/dir/bar.h", file->getName());
163 const DirectoryEntry *dir = file->getDir();
171 // Inject two fake files into the file system. Different inodes
186 // getFile() returns NULL if neither a real file nor a virtual file
189 // Inject a fake foo.cpp into the file system.
195 // Create a virtual bar.cpp file.
198 const FileEntry *file = manager.getFile("xyz.txt");
199 EXPECT_EQ(NULL, file);