#include "file_system_test_base.h"
|
void | CheckDoesNotExist (const GoogleString &filename) |
|
void | CheckRead (const GoogleString &filename, const GoogleString &expected_contents) |
|
void | CheckInputFileRead (const GoogleString &filename, const GoogleString &expected_contents) |
|
virtual void | DeleteRecursively (const StringPiece &filename)=0 |
|
virtual FileSystem * | file_system ()=0 |
| Provide a pointer to your favorite filesystem implementation.
|
|
virtual Timer * | timer ()=0 |
| Pointer to a timer to use in tests.
|
|
const GoogleString & | test_tmpdir () |
| Provide a temporary directory for tests to put files in.
|
|
GoogleString | WriteNewFile (const StringPiece &suffix, const GoogleString &content) |
|
virtual int | FileSize (StringPiece contents) const =0 |
|
int | FileContentSize (StringPiece contents) const |
|
int | FileBlockSize (StringPiece contents, int64 default_file_size) const |
|
virtual int | DefaultDirSize () const =0 |
|
void | TestWriteRead () |
|
void | TestTemp () |
|
void | TestAppend () |
|
void | TestRename () |
|
void | TestRemove () |
|
void | TestExists () |
|
void | TestCreateFileInDir () |
|
void | TestMakeDir () |
|
void | TestRemoveDir () |
|
void | TestIsDir () |
|
void | TestRecursivelyMakeDir () |
|
void | TestRecursivelyMakeDir_NoPermission () |
|
void | TestRecursivelyMakeDir_FileInPath () |
|
void | TestListContents () |
|
void | TestAtime () |
|
void | TestMtime () |
|
void | TestDirInfo () |
|
void | TestLock () |
|
void | TestLockTimeout () |
|
void | TestLockBumping () |
|
- Todo:
- TODO(huibao): Rename FileSystemTest to FileSystemTestBase.
Base class for testing a FileSystem implementation. Subclasses must implement DeleteRecursively and GetFileSystem, then should create their own tests calling each of our Test* methods.
virtual int net_instaweb::FileSystemTest::DefaultDirSize |
( |
| ) |
const |
|
protectedpure virtual |
Return the size of directories in the file system. This can vary depending on the implementation, since directories in disk-based file systems can consume a disk block.
virtual void net_instaweb::FileSystemTest::DeleteRecursively |
( |
const StringPiece & |
filename | ) |
|
|
protectedpure virtual |
Delete (at least) the named file or directory and everything underneath it. The test is permitted to delete more things (up to and including the entire file system).
int net_instaweb::FileSystemTest::FileBlockSize |
( |
StringPiece |
contents, |
|
|
int64 |
default_file_size |
|
) |
| const |
|
inlineprotected |
Calculate on-disk usage of contents by returning size rounded up to nearest default block size.
virtual int net_instaweb::FileSystemTest::FileSize |
( |
StringPiece |
contents | ) |
const |
|
protectedpure virtual |
Memory based file system implementations of Size return the size of the file, while the APR file system returns the size allocated on disk. This function is overridable to allow AprFileSystemTest and StdioFileSystemTest to calculate the on-disk size of the file.
void net_instaweb::FileSystemTest::TestWriteRead |
( |
| ) |
|
|
protected |
All FileSystem implementations should run the following tests. Note: If you add a test below, please add invocations in: AprFileSystemTest, StdioFileSystemTest, MemFileSystemTest.
The documentation for this class was generated from the following file: