Remove PluginMetadata::Name() setter.

There's no reason for a PluginMetadata object's name to be changed after
creation.
This commit is contained in:
Oliver Hamlet
2015-07-13 10:49:26 +01:00
parent c50905faaa
commit a5796d21cc
3 changed files with 7 additions and 19 deletions
+1 -5
View File
@@ -220,10 +220,6 @@ namespace loot {
return _locations;
}
void PluginMetadata::Name(const std::string& n) {
name = n;
}
void PluginMetadata::Enabled(const bool e) {
enabled = e;
}
@@ -415,4 +411,4 @@ namespace YAML {
return out;
}
}
}
-1
View File
@@ -77,7 +77,6 @@ namespace loot {
std::set<PluginDirtyInfo> DirtyInfo() const;
std::set<Location> Locations() const;
void Name(const std::string& name);
void Enabled(const bool enabled);
void SetPriorityExplicit(bool state);
void Priority(const int priority);
@@ -370,13 +370,6 @@ TEST_F(PluginMetadata, NewMetadata) {
EXPECT_FALSE(result.IsPriorityExplicit());
}
TEST_F(PluginMetadata, Name) {
loot::PluginMetadata pm;
ASSERT_NE("Blank.esm", pm.Name());
pm.Name("Blank.esm");
EXPECT_EQ("Blank.esm", pm.Name());
}
TEST_F(PluginMetadata, Enabled) {
loot::PluginMetadata pm;
ASSERT_TRUE(pm.Enabled());
@@ -604,22 +597,22 @@ TEST_F(PluginMetadata, IsRegexPlugin) {
loot::PluginMetadata pm;
EXPECT_FALSE(pm.IsRegexPlugin());
pm.Name("Blank.esm");
pm = loot::PluginMetadata("Blank.esm");
EXPECT_FALSE(pm.IsRegexPlugin());
pm.Name("Blank[[:blank:]]- Different.esm");
pm = loot::PluginMetadata("Blank[[:blank:]]- Different.esm");
EXPECT_FALSE(pm.IsRegexPlugin());
pm.Name("Blank\\.esm");
pm = loot::PluginMetadata("Blank\\.esm");
EXPECT_TRUE(pm.IsRegexPlugin());
pm.Name("Blank - (Different )*Master Dependent.esm");
pm = loot::PluginMetadata("Blank - (Different )*Master Dependent.esm");
EXPECT_FALSE(pm.IsRegexPlugin());
pm.Name("Blank - (Different )?Master Dependent.esm");
pm = loot::PluginMetadata("Blank - (Different )?Master Dependent.esm");
EXPECT_FALSE(pm.IsRegexPlugin());
pm.Name("Blank.es(p|m)");
pm = loot::PluginMetadata("Blank.es(p|m)");
EXPECT_FALSE(pm.IsRegexPlugin());
}