Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
TestFileSys Class Reference
+ Inheritance diagram for TestFileSys:
+ Collaboration diagram for TestFileSys:

Public Member Functions

 TestFileSys ()
 
const char * getName ()
 
void runTests (IGameDef *gamedef)
 
void testIsDirDelimiter ()
 
void testPathStartsWith ()
 
void testRemoveLastPathComponent ()
 
void testRemoveLastPathComponentWithTrailingDelimiter ()
 
void testRemoveRelativePathComponent ()
 
void testAbsolutePath ()
 
void testSafeWriteToFile ()
 
void testCopyFileContents ()
 
void testNonExist ()
 
void testRecursiveDelete ()
 
void testGetRecursiveSubPaths ()
 
- Public Member Functions inherited from TestBase
bool testModule (IGameDef *gamedef)
 
std::string getTestTempDirectory ()
 
std::string getTestTempFile ()
 
void runTest (const char *name, std::function< void()> &&test)
 

Additional Inherited Members

- Public Attributes inherited from TestBase
u32 num_tests_failed
 
u32 num_tests_run
 

Constructor & Destructor Documentation

◆ TestFileSys()

TestFileSys::TestFileSys ( )
inline

References TestManager::registerTestModule().

+ Here is the call graph for this function:

Member Function Documentation

◆ getName()

const char * TestFileSys::getName ( )
inlinevirtual

Implements TestBase.

◆ runTests()

void TestFileSys::runTests ( IGameDef * gamedef)
virtual

Implements TestBase.

References TEST, testAbsolutePath(), testCopyFileContents(), testGetRecursiveSubPaths(), testIsDirDelimiter(), testNonExist(), testPathStartsWith(), testRecursiveDelete(), testRemoveLastPathComponent(), testRemoveLastPathComponentWithTrailingDelimiter(), testRemoveRelativePathComponent(), and testSafeWriteToFile().

+ Here is the call graph for this function:

◆ testAbsolutePath()

void TestFileSys::testAbsolutePath ( )

References fs::AbsolutePath(), fs::AbsolutePathPartial(), fs::CreateDir(), DIR_DELIM, TestBase::getTestTempDirectory(), TestBase::getTestTempFile(), p(), UASSERTCMP, and UASSERTEQ.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testCopyFileContents()

void TestFileSys::testCopyFileContents ( )

References fs::CopyFileContents(), DIR_DELIM, TestBase::getTestTempDirectory(), fs::ReadFile(), UASSERT, and UASSERTEQ.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testGetRecursiveSubPaths()

void TestFileSys::testGetRecursiveSubPaths ( )

References CONTAINS, fs::CreateAllDirs(), fs::CreateDir(), DIR_DELIM, fs::GetRecursiveSubPaths(), TestBase::getTestTempDirectory(), open_ofstream(), UASSERT, and UASSERTEQ.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testIsDirDelimiter()

void TestFileSys::testIsDirDelimiter ( )

References fs::IsDirDelimiter(), UASSERT, and win32.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNonExist()

void TestFileSys::testNonExist ( )

References fs::DeleteSingleFileOrEmptyDirectory(), TestBase::getTestTempFile(), fs::IsDir(), fs::IsExecutable(), fs::IsFile(), open_ifstream(), fs::OpenStream(), fs::ReadFile(), fs::Rename(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testPathStartsWith()

void TestFileSys::testPathStartsWith ( )

References FILESYS_CASE_INSENSITIVE, p(), fs::PathStartsWith(), UASSERT, and win32.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testRecursiveDelete()

void TestFileSys::testRecursiveDelete ( )

References fs::CreateDir(), DIR_DELIM, TestBase::getTestTempDirectory(), fs::IsDir(), fs::IsFile(), open_ofstream(), fs::RecursiveDelete(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testRemoveLastPathComponent()

void TestFileSys::testRemoveLastPathComponent ( )

References p(), fs::RemoveLastPathComponent(), UASSERT, UASSERTEQ, and win32.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testRemoveLastPathComponentWithTrailingDelimiter()

void TestFileSys::testRemoveLastPathComponentWithTrailingDelimiter ( )

References p(), fs::RemoveLastPathComponent(), UASSERT, UASSERTEQ, and win32.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testRemoveRelativePathComponent()

void TestFileSys::testRemoveRelativePathComponent ( )

References p(), fs::RemoveRelativePathComponents(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testSafeWriteToFile()

void TestFileSys::testSafeWriteToFile ( )

References fs::DeleteSingleFileOrEmptyDirectory(), DIR_DELIM, TestBase::getTestTempFile(), fs::IsFile(), itos(), fs::PathExists(), fs::ReadFile(), fs::safeWriteToFile(), fs::TempPath(), UASSERT, and UASSERTEQ.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: