mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-15 02:36:43 -04:00
fixed bug that INI group might already been destroyed while iterating the group
This commit is contained in:
parent
f1b969219a
commit
48c9065537
2 changed files with 15 additions and 4 deletions
|
@ -29,12 +29,18 @@ TEST(IniFileGroup, ValidIniWithValidContentTest) {
|
|||
|
||||
auto const bldTypes = group.GetSection("BuildingTypes");
|
||||
auto idx = 0;
|
||||
//for (auto const& [key, val] : bldTypes) {
|
||||
|
||||
for (auto it = bldTypes.begin(); it != bldTypes.end(); ++it) {
|
||||
auto const& [key, val] = *it;
|
||||
EXPECT_EQ(val, referenceList[idx++]);
|
||||
}
|
||||
|
||||
// This is to test RHS issue
|
||||
idx = 0;
|
||||
for (auto const& [key, val] : group.GetSection("BuildingTypes")) {
|
||||
EXPECT_EQ(val, referenceList[idx++]);
|
||||
}
|
||||
|
||||
EXPECT_EQ(group.GetString("GACNST", "Strength"), "2000");
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue