diff --git a/src/tests/api/api.h b/src/tests/api/api.h index 5dd5836c..545b06ce 100644 --- a/src/tests/api/api.h +++ b/src/tests/api/api.h @@ -244,8 +244,7 @@ TEST_F(OblivionAPIOperationsTest, GetPluginMessages) { EXPECT_EQ(loot_error_invalid_args, loot_get_plugin_messages(db, "EnhancedWeatherSIOnly.esm", &messages, NULL)); // Fetch and load the metadata. - bool updated; - ASSERT_EQ(loot_ok, loot_update_masterlist(db, masterlistPath.string().c_str(), "https://github.com/loot/oblivion.git", "master", &updated)); + ASSERT_NO_THROW(GenerateMasterlist()); ASSERT_EQ(loot_ok, loot_load_lists(db, masterlistPath.string().c_str(), NULL)); // Test for plugin with no messages. @@ -287,8 +286,7 @@ TEST_F(OblivionAPIOperationsTest, GetDirtyInfo) { EXPECT_EQ(loot_error_invalid_args, loot_get_dirty_info(db, "Oblivion.esm", NULL)); // Fetch and load the metadata. - bool updated; - ASSERT_EQ(loot_ok, loot_update_masterlist(db, masterlistPath.string().c_str(), "https://github.com/loot/oblivion.git", "master", &updated)); + ASSERT_NO_THROW(GenerateMasterlist()); ASSERT_EQ(loot_ok, loot_load_lists(db, masterlistPath.string().c_str(), NULL)); // A plugin with no metadata. diff --git a/src/tests/fixtures.h b/src/tests/fixtures.h index 1884d3d5..92485f8b 100644 --- a/src/tests/fixtures.h +++ b/src/tests/fixtures.h @@ -169,6 +169,66 @@ protected: // Delete existing plugins.txt. ASSERT_NO_THROW(boost::filesystem::remove(localPath / "plugins.txt")); }; + + inline void GenerateMasterlist() { + loot::ofstream masterlist(masterlistPath); + masterlist + << "plugins:" << std::endl + << " - name: Oblivion.esm" << std::endl + << " - name: Silgrad_Tower.esm" << std::endl + << " - name: No Lights Flicker.esm" << std::endl + << " msg:" << std::endl + << " - type: say" << std::endl + << " content: Use Wrye Bash Bashed Patch tweak instead." << std::endl + << " - name: bookplacing.esm" << std::endl + << " msg:" << std::endl + << " - type: warn" << std::endl + << " content: 'Check you are using v2+. If not, Update. v1 has a severe bug with the Mystic Emporium disappearing.'" << std::endl + << " - name: EnhancedWeatherSIOnly.esm" << std::endl + << " msg:" << std::endl + << " - type: error" << std::endl + << " content: Obsolete. Remove this and install Enhanced Weather." << std::endl + << " - name: Hammerfell.esm" << std::endl + << " dirty:" << std::endl + << " - crc: 0x7d22f9df" << std::endl + << " util: TES4Edit" << std::endl + << " udr: 4" << std::endl + << " - name: nVidia Black Screen Fix.esp" << std::endl + << " msg:" << std::endl + << " - type: say" << std::endl + << " content: Use Wrye Bash Bashed Patch tweak instead." << std::endl + << " - type: say" << std::endl + << " content: 'Alternatively, remove this and use UOP v3.0.1+ instead.'" << std::endl + << " - name: Unofficial Oblivion Patch.esp" << std::endl + << " msg:" << std::endl + << " - type: say" << std::endl + << " content: 'Do not clean ITM records, they are intentional and required for the mod to function.'" << std::endl + << " tag:" << std::endl + << " - Actors.ACBS" << std::endl + << " - Actors.AIData" << std::endl + << " - Actors.AIPackages" << std::endl + << " - Actors.CombatStyle" << std::endl + << " - Actors.DeathItem" << std::endl + << " - Actors.Stats" << std::endl + << " - C.Climate" << std::endl + << " - C.Light" << std::endl + << " - C.Music" << std::endl + << " - C.Name" << std::endl + << " - C.Owner" << std::endl + << " - Creatures.Blood" << std::endl + << " - Delev" << std::endl + << " - Factions" << std::endl + << " - Invent" << std::endl + << " - Names" << std::endl + << " - NPC.Class" << std::endl + << " - Relations" << std::endl + << " - Relev" << std::endl + << " - Scripts" << std::endl + << " - Stats" << std::endl + << " - '-C.Water'" << std::endl; + + masterlist.close(); + } }; class OblivionAPIOperationsTest : public OblivionTest {