diff --git a/modules/rostests/apitests/shell32/LocaleTests.cpp b/modules/rostests/apitests/shell32/LocaleTests.cpp index f98b8940570ff..0c62da178d9f6 100644 --- a/modules/rostests/apitests/shell32/LocaleTests.cpp +++ b/modules/rostests/apitests/shell32/LocaleTests.cpp @@ -62,15 +62,24 @@ std::set langs; std::map mod; std::map parts; -static void InitParts(void) +struct PART_PAIR { + E_STRING eString; PART_TEST part_test; -#define DEFINE_PART(eString, eModule, id, nParts) do { \ - part_test = { eModule, id, nParts }; \ - parts.insert(std::make_pair(eString, part_test)); \ - } while (0); +}; + +static void InitParts(void) +{ + static const PART_PAIR s_pairs[] = + { +#define DEFINE_PART(eString, eModule, id, nParts) { eString, { eModule, id, nParts } }, #include "parts.h" #undef DEFINE_PART + }; + for (auto& pair : s_pairs) + { + parts.insert(std::make_pair(pair.eString, pair.part_test)); + } } static PART_MATCH PartMatches[] =