Don't do nothing when redating Skyrim SE plugins

This commit is contained in:
Oliver Hamlet
2016-11-20 21:55:25 +00:00
parent cf4d38276b
commit 1806e6275c
2 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -79,8 +79,10 @@ void Game::Init(bool createFolder, const boost::filesystem::path& gameLocalAppDa
}
void Game::RedatePlugins() {
if (Type() != GameType::tes5)
if (Type() != GameType::tes5 && Type() != GameType::tes5se) {
BOOST_LOG_TRIVIAL(warning) << "Cannot redate plugins for game " << Name();
return;
}
vector<string> loadorder = GetLoadOrder();
if (!loadorder.empty()) {
+4 -3
View File
@@ -139,13 +139,13 @@ TEST_P(GameTest, redatePluginsShouldThrowIfTheGameHasNotYetBeenInitialisedForSky
Game game(GetParam());
game.SetGamePath(dataPath.parent_path());
if (GetParam() == GameType::tes5)
if (GetParam() == GameType::tes5 || GetParam() == GameType::tes5se)
EXPECT_THROW(game.RedatePlugins(), std::system_error);
else
EXPECT_NO_THROW(game.RedatePlugins());
}
TEST_P(GameTest, redatePluginsShouldRedatePluginsForSkyrimAndDoNothingForOtherGames) {
TEST_P(GameTest, redatePluginsShouldRedatePluginsForSkyrimAndSkyrimSEAndDoNothingForOtherGames) {
Game game(GetParam());
game.SetGamePath(dataPath.parent_path());
game.Init(false, localPath);
@@ -165,8 +165,9 @@ TEST_P(GameTest, redatePluginsShouldRedatePluginsForSkyrimAndDoNothingForOtherGa
EXPECT_NO_THROW(game.RedatePlugins());
time_t interval = 60;
if (GetParam() != GameType::tes5)
if (GetParam() != GameType::tes5 && GetParam() != GameType::tes5se)
interval *= -1;
for (size_t i = 0; i < loadOrder.size(); ++i) {
EXPECT_EQ(time + i * interval, boost::filesystem::last_write_time(dataPath / loadOrder[i].first));
}