diff --git a/apps/openmw_test_suite/esm3/testsaveload.cpp b/apps/openmw_test_suite/esm3/testsaveload.cpp index ab08c72e4d..09b5b11ed4 100644 --- a/apps/openmw_test_suite/esm3/testsaveload.cpp +++ b/apps/openmw_test_suite/esm3/testsaveload.cpp @@ -71,11 +71,16 @@ namespace ESM { using namespace ::testing; - constexpr std::array formats = { - MaxLimitedSizeStringsFormatVersion, - MaxStringRefIdFormatVersion, - CurrentSaveGameFormatVersion, - }; + std::vector getFormats() + { + std::vector result({ + MaxLimitedSizeStringsFormatVersion, + MaxStringRefIdFormatVersion, + }); + for (ESM::FormatVersion v = result.back() + 1; v <= ESM::CurrentSaveGameFormatVersion; ++v) + result.push_back(v); + return result; + } constexpr std::uint32_t fakeRecordId = fourCC("FAKE"); @@ -327,6 +332,6 @@ namespace ESM EXPECT_EQ(result.mKeys, record.mKeys); } - INSTANTIATE_TEST_SUITE_P(FormatVersions, Esm3SaveLoadRecordTest, ValuesIn(formats)); + INSTANTIATE_TEST_SUITE_P(FormatVersions, Esm3SaveLoadRecordTest, ValuesIn(getFormats())); } } diff --git a/apps/openmw_test_suite/mwworld/test_store.cpp b/apps/openmw_test_suite/mwworld/test_store.cpp index 268bc8bc0b..8872f4e50b 100644 --- a/apps/openmw_test_suite/mwworld/test_store.cpp +++ b/apps/openmw_test_suite/mwworld/test_store.cpp @@ -269,22 +269,27 @@ std::unique_ptr getEsmFile(T record, bool deleted, ESM::FormatVers namespace { - constexpr std::array formats = { - ESM::DefaultFormatVersion, - ESM::CurrentContentFormatVersion, - ESM::MaxOldWeatherFormatVersion, - ESM::MaxOldDeathAnimationFormatVersion, - ESM::MaxOldForOfWarFormatVersion, - ESM::MaxWerewolfDeprecatedDataFormatVersion, - ESM::MaxOldTimeLeftFormatVersion, - ESM::MaxIntFallbackFormatVersion, - ESM::MaxClearModifiersFormatVersion, - ESM::MaxOldAiPackageFormatVersion, - ESM::MaxOldSkillsAndAttributesFormatVersion, - ESM::MaxOldCreatureStatsFormatVersion, - ESM::MaxStringRefIdFormatVersion, - ESM::CurrentSaveGameFormatVersion, - }; + std::vector getFormats() + { + std::vector result({ + ESM::DefaultFormatVersion, + ESM::CurrentContentFormatVersion, + ESM::MaxOldWeatherFormatVersion, + ESM::MaxOldDeathAnimationFormatVersion, + ESM::MaxOldForOfWarFormatVersion, + ESM::MaxWerewolfDeprecatedDataFormatVersion, + ESM::MaxOldTimeLeftFormatVersion, + ESM::MaxIntFallbackFormatVersion, + ESM::MaxClearModifiersFormatVersion, + ESM::MaxOldAiPackageFormatVersion, + ESM::MaxOldSkillsAndAttributesFormatVersion, + ESM::MaxOldCreatureStatsFormatVersion, + ESM::MaxStringRefIdFormatVersion, + }); + for (ESM::FormatVersion v = result.back() + 1; v <= ESM::CurrentSaveGameFormatVersion; ++v) + result.push_back(v); + return result; + } template > struct HasBlankFunction : std::false_type @@ -305,7 +310,7 @@ TYPED_TEST_P(StoreTest, delete_test) { using RecordType = TypeParam; - for (const ESM::FormatVersion formatVersion : formats) + for (const ESM::FormatVersion formatVersion : getFormats()) { SCOPED_TRACE("FormatVersion: " + std::to_string(formatVersion)); const ESM::RefId recordId = ESM::RefId::stringRefId("foobar"); @@ -383,7 +388,7 @@ TYPED_TEST_P(StoreTest, overwrite_test) { using RecordType = TypeParam; - for (const ESM::FormatVersion formatVersion : formats) + for (const ESM::FormatVersion formatVersion : getFormats()) { SCOPED_TRACE("FormatVersion: " + std::to_string(formatVersion)); @@ -442,7 +447,7 @@ namespace else refId = ESM::StringRefId("foobar"); - for (const ESM::FormatVersion formatVersion : formats) + for (const ESM::FormatVersion formatVersion : getFormats()) { SCOPED_TRACE("FormatVersion: " + std::to_string(formatVersion));