Various updater fixes

Updater tests for path utils
The updater now doesn't use splitpath on Windows (fixes problems with Windows XP)
Fix up paths for the OSX updater - should now install the updates into the right place
Fix translations install path - translation isntall and deploy should be fixed
This commit is contained in:
Petr Mrázek
2013-12-28 02:03:53 +01:00
parent 30d4f5981d
commit 7652b3d64a
10 changed files with 171 additions and 59 deletions

View File

@@ -5,10 +5,39 @@
void TestFileUtils::testDirName()
{
std::string dirName;
std::string fileName;
#ifdef PLATFORM_WINDOWS
std::string dirName = FileUtils::dirname("E:/Some Dir/App.exe");
TEST_COMPARE(dirName,"E:/Some Dir/");
// absolute paths
dirName = FileUtils::dirname("E:/Some Dir/App.exe");
TEST_COMPARE(dirName,"E:/Some Dir");
fileName = FileUtils::fileName("E:/Some Dir/App.exe");
TEST_COMPARE(fileName,"App.exe");
dirName = FileUtils::dirname("C:/Users/kitteh/AppData/Local/Temp/MultiMC5-yidaaa/MultiMC.exe");
TEST_COMPARE(dirName,"C:/Users/kitteh/AppData/Local/Temp/MultiMC5-yidaaa");
fileName = FileUtils::fileName("C:/Users/kitteh/AppData/Local/Temp/MultiMC5-yidaaa/MultiMC.exe");
TEST_COMPARE(fileName,"MultiMC.exe");
#else
// absolute paths
dirName = FileUtils::dirname("/home/tester/foo bar/baz");
TEST_COMPARE(dirName,"/home/tester/foo bar");
fileName = FileUtils::fileName("/home/tester/foo bar/baz");
TEST_COMPARE(fileName,"baz");
#endif
// current directory
dirName = FileUtils::dirname("App.exe");
TEST_COMPARE(dirName,".");
fileName = FileUtils::fileName("App.exe");
TEST_COMPARE(fileName,"App.exe");
// relative paths
dirName = FileUtils::dirname("Foo/App.exe");
TEST_COMPARE(dirName,"Foo");
fileName = FileUtils::fileName("Foo/App.exe");
TEST_COMPARE(fileName,"App.exe");
}
void TestFileUtils::testIsRelative()