Remove unused LootPaths functions

They were only used for tests, but weren't necessary.
This commit is contained in:
Oliver Hamlet
2016-07-13 20:47:22 +01:00
parent 36991f683b
commit 58734a7089
3 changed files with 13 additions and 29 deletions
+2 -10
View File
@@ -75,14 +75,6 @@ namespace loot {
lootDataPath = getLocalAppDataPath() / "LOOT";
}
void LootPaths::setLootAppPath(const boost::filesystem::path& path) {
lootAppPath = path;
}
void LootPaths::setLootDataPath(const boost::filesystem::path& path) {
lootDataPath = path;
}
boost::filesystem::path LootPaths::getLocalAppDataPath() {
#ifdef _WIN32
HWND owner = 0;
@@ -113,6 +105,6 @@ namespace loot {
#endif
}
boost::filesystem::path LootPaths::lootAppPath = boost::filesystem::path();
boost::filesystem::path LootPaths::lootDataPath = boost::filesystem::path();
boost::filesystem::path LootPaths::lootAppPath;
boost::filesystem::path LootPaths::lootDataPath;
}
-2
View File
@@ -40,8 +40,6 @@ namespace loot {
// Sets the app path to the current path, and the data path to the user
// local app data path / "LOOT".
static void initialise();
static void setLootAppPath(const boost::filesystem::path& path);
static void setLootDataPath(const boost::filesystem::path& path);
private:
static boost::filesystem::path lootAppPath;
static boost::filesystem::path lootDataPath;
+11 -17
View File
@@ -32,39 +32,33 @@ along with LOOT. If not, see
namespace loot {
namespace test {
TEST(LootPaths, getReadmePathShouldUseLootAppPath) {
LootPaths::setLootAppPath("readme");
LootPaths::initialise();
EXPECT_EQ(boost::filesystem::path("readme") / "docs" / "LOOT Readme.html", LootPaths::getReadmePath());
EXPECT_EQ(boost::filesystem::current_path() / "docs" / "LOOT Readme.html", LootPaths::getReadmePath());
}
TEST(LootPaths, getUIIndexPathShouldUseLootAppPath) {
LootPaths::setLootAppPath("ui");
LootPaths::initialise();
EXPECT_EQ(boost::filesystem::path("ui") / "resources" / "ui" / "index.html", LootPaths::getUIIndexPath());
EXPECT_EQ(boost::filesystem::current_path() / "resources" / "ui" / "index.html", LootPaths::getUIIndexPath());
}
TEST(LootPaths, getL10nPathShouldUseLootAppPath) {
LootPaths::setLootAppPath("l10n");
LootPaths::initialise();
EXPECT_EQ(boost::filesystem::path("l10n") / "resources" / "l10n", LootPaths::getL10nPath());
}
TEST(LootPaths, getLootDataPathShouldReturnTheSetPath) {
LootPaths::setLootDataPath("data");
EXPECT_EQ("data", LootPaths::getLootDataPath());
EXPECT_EQ(boost::filesystem::current_path() / "resources" / "l10n", LootPaths::getL10nPath());
}
TEST(LootPaths, getSettingsPathShouldUseLootDataPath) {
LootPaths::setLootDataPath("settings");
LootPaths::initialise();
EXPECT_EQ(boost::filesystem::path("settings") / "settings.yaml", LootPaths::getSettingsPath());
EXPECT_EQ(LootPaths::getLootDataPath() / "settings.yaml", LootPaths::getSettingsPath());
}
TEST(LootPaths, getLogPathShouldUseLootDataPath) {
LootPaths::setLootDataPath("log");
LootPaths::initialise();
EXPECT_EQ(boost::filesystem::path("log") / "LOOTDebugLog.txt", LootPaths::getLogPath());
EXPECT_EQ(LootPaths::getLootDataPath() / "LOOTDebugLog.txt", LootPaths::getLogPath());
}
TEST(LootPaths, initialiseShouldSetTheAppPathToTheCurrentPath) {
@@ -73,7 +67,7 @@ namespace loot {
EXPECT_EQ(boost::filesystem::current_path(), LootPaths::getReadmePath().parent_path().parent_path());
}
TEST(LootPaths, initialiseShouldSetTheAppPathToTheLocalAppDataPathSlashLoot) {
TEST(LootPaths, initialiseShouldSetTheDataPathToTheLocalAppDataPathSlashLoot) {
LootPaths::initialise();
// Can't actually know what the path should be, but we can check