Add a few more C++ error message tests

This commit is contained in:
Oliver Hamlet
2025-08-06 09:22:23 +01:00
parent c524ec824f
commit 00ee2b42a6
2 changed files with 23 additions and 1 deletions
@@ -434,6 +434,23 @@ TEST_P(DatabaseInterfaceTest,
}
}
TEST_P(DatabaseInterfaceTest, getGroupsPathShouldThrowIfAGroupIsNotDefined) {
auto& db = handle_->GetDatabase();
auto group1Name = "group1";
auto group2Name = "group2";
Group group1(group1Name, {group2Name});
db.SetUserGroups({group1});
try {
handle_->GetDatabase().GetGroupsPath(group1Name, group2Name);
FAIL();
} catch (UndefinedGroupError& e) {
EXPECT_EQ(group2Name, e.GetGroupName());
}
}
TEST_P(DatabaseInterfaceTest,
getKnownBashTagsShouldReturnAllBashTagsListedInLoadedMetadata) {
ASSERT_NO_THROW(GenerateMasterlist());
@@ -473,7 +473,12 @@ TEST_P(GameInterfaceTest,
TEST_P(GameInterfaceTest, sortPluginsShouldThrowIfAGivenPluginIsNotLoaded) {
std::vector<std::string> plugins{blankEsp, blankDifferentEsp};
EXPECT_THROW(handle_->SortPlugins(plugins), PluginNotLoadedError);
try {
handle_->SortPlugins(plugins);
FAIL();
} catch (PluginNotLoadedError& e) {
EXPECT_STREQ("The plugin \"Blank.esp\" has not been loaded", e.what());
}
}
TEST_P(GameInterfaceTest, sortPluginsShouldThrowIfACyclicInteractionOccurs) {