Remove unused Plugin member function and variable

This commit is contained in:
Oliver Hamlet
2017-10-08 15:27:35 +01:00
parent 363198a1c7
commit 8b6da099d5
3 changed files with 0 additions and 46 deletions
-14
View File
@@ -176,20 +176,6 @@ size_t Plugin::NumOverrideFormIDs() const {
return numOverrideRecords_;
}
std::set<FormId> Plugin::OverlapFormIDs(const Plugin& plugin) const {
set<FormId> formIds(getFormIds());
set<FormId> otherFormIds(plugin.getFormIds());
set<FormId> overlap;
set_intersection(begin(formIds),
end(formIds),
begin(otherFormIds),
end(otherFormIds),
inserter(overlap, end(overlap)));
return overlap;
}
bool Plugin::IsValid(const std::string& filename, const GameType gameType, const boost::filesystem::path& dataPath) {
BOOST_LOG_TRIVIAL(trace) << "Checking to see if \"" << filename << "\" is a valid plugin.";
-2
View File
@@ -63,7 +63,6 @@ public:
//Load ordering functions.
size_t NumOverrideFormIDs() const;
std::set<libespm::FormId> OverlapFormIDs(const Plugin& plugin) const;
// Validity checks.
static bool IsValid(const std::string& filename, const GameType gameType, const boost::filesystem::path& dataPath);
@@ -82,7 +81,6 @@ private:
std::string version_; //Obtained from description field.
uint32_t crc_;
std::set<Tag> tags_;
std::vector<Message> messages_;
//Useful caches.
size_t numOverrideRecords_;
@@ -269,36 +269,6 @@ TEST_P(PluginTest, doFormIDsOverlapShouldReturnTrueIfOnePluginOverridesTheOthers
EXPECT_TRUE(plugin1.DoFormIDsOverlap(plugin2));
EXPECT_TRUE(plugin2.DoFormIDsOverlap(plugin1));
}
TEST_P(PluginTest, overlapFormIDsShouldReturnAnEmptySetForTwoPluginsWithOnlyHeadersLoaded) {
Plugin plugin1(game_.Type(), game_.DataPath(), game_.GetLoadOrderHandler(), blankEsm, true);
Plugin plugin2(game_.Type(), game_.DataPath(), game_.GetLoadOrderHandler(), blankMasterDependentEsm, true);
EXPECT_TRUE(plugin1.OverlapFormIDs(plugin2).empty());
EXPECT_TRUE(plugin2.OverlapFormIDs(plugin1).empty());
}
TEST_P(PluginTest, overlapFormIDsShouldReturnAnEmptySetIfThePluginsHaveUnrelatedRecords) {
Plugin plugin1(game_.Type(), game_.DataPath(), game_.GetLoadOrderHandler(), blankEsm, false);
Plugin plugin2(game_.Type(), game_.DataPath(), game_.GetLoadOrderHandler(), blankEsp, false);
EXPECT_TRUE(plugin1.OverlapFormIDs(plugin2).empty());
EXPECT_TRUE(plugin2.OverlapFormIDs(plugin1).empty());
}
TEST_P(PluginTest, overlapFormIDsShouldReturnTheFormIDsOfRecordsAddedByOnePluginAndOverriddenByTheOther) {
Plugin plugin1(game_.Type(), game_.DataPath(), game_.GetLoadOrderHandler(), blankEsm, false);
Plugin plugin2(game_.Type(), game_.DataPath(), game_.GetLoadOrderHandler(), blankMasterDependentEsm, false);
std::set<libespm::FormId> expectedFormIds({
libespm::FormId(blankEsm, std::vector<std::string>(), 0xCF0),
libespm::FormId(blankEsm, std::vector<std::string>(), 0xCF1),
libespm::FormId(blankEsm, std::vector<std::string>(), 0xCF2),
libespm::FormId(blankEsm, std::vector<std::string>(), 0xCF3),
});
EXPECT_EQ(expectedFormIds, plugin1.OverlapFormIDs(plugin2));
EXPECT_EQ(expectedFormIds, plugin2.OverlapFormIDs(plugin1));
}
}
}