1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Tests: Modularize unit testing

Split unit tests into separate files under src/unittest/
Give better unittest diagnostics
Clean up some code
This commit is contained in:
kwolekr 2015-04-26 01:24:19 -04:00
parent 45a77c8bf1
commit 7220ca906d
25 changed files with 3402 additions and 2502 deletions

View file

@ -662,6 +662,12 @@ std::string RemoveRelativePathComponents(std::string path)
return path.substr(0, pos);
}
const char *GetFilenameFromPath(const char *path)
{
const char *filename = strrchr(path, DIR_DELIM_CHAR);
return filename ? filename + 1 : path;
}
bool safeWriteToFile(const std::string &path, const std::string &content)
{
std::string tmp_file = path + ".~mt";