diff --git a/src/api/plugin/plugin.cpp b/src/api/plugin/plugin.cpp index c73935a3..34fa2049 100644 --- a/src/api/plugin/plugin.cpp +++ b/src/api/plugin/plugin.cpp @@ -176,20 +176,6 @@ size_t Plugin::NumOverrideFormIDs() const { return numOverrideRecords_; } -std::set Plugin::OverlapFormIDs(const Plugin& plugin) const { - set formIds(getFormIds()); - set otherFormIds(plugin.getFormIds()); - set 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."; diff --git a/src/api/plugin/plugin.h b/src/api/plugin/plugin.h index 94386bec..7971c3c5 100644 --- a/src/api/plugin/plugin.h +++ b/src/api/plugin/plugin.h @@ -63,7 +63,6 @@ public: //Load ordering functions. size_t NumOverrideFormIDs() const; - std::set 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 tags_; - std::vector messages_; //Useful caches. size_t numOverrideRecords_; diff --git a/src/tests/api/internals/plugin/plugin_test.h b/src/tests/api/internals/plugin/plugin_test.h index 720b9c6c..cfb25998 100644 --- a/src/tests/api/internals/plugin/plugin_test.h +++ b/src/tests/api/internals/plugin/plugin_test.h @@ -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 expectedFormIds({ - libespm::FormId(blankEsm, std::vector(), 0xCF0), - libespm::FormId(blankEsm, std::vector(), 0xCF1), - libespm::FormId(blankEsm, std::vector(), 0xCF2), - libespm::FormId(blankEsm, std::vector(), 0xCF3), - }); - EXPECT_EQ(expectedFormIds, plugin1.OverlapFormIDs(plugin2)); - EXPECT_EQ(expectedFormIds, plugin2.OverlapFormIDs(plugin1)); -} } }