mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Add a few more C++ error message tests
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user