mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-05 06:00:29 -04:00
Enhance:ini registry sequence (#121)
* '+=' supported . * introduced registry list value deduplication . * TechnoType listing now parse data both from ini and map . * added UT case .
This commit is contained in:
parent
3e90dca667
commit
93e956e7ac
8 changed files with 164 additions and 50 deletions
|
@ -275,4 +275,34 @@ TEST(CIniFileClass, IniLowerBoundInsertTest) {
|
|||
EXPECT_EQ(987654, file.GetInteger("Waypoints", "11"));
|
||||
EXPECT_EQ("987654", file["Waypoints"].Nth(pSec->Size() - 1).second);
|
||||
EXPECT_EQ("159356", file["Waypoints"].Nth(pSec->Size() - 2).second);
|
||||
}
|
||||
|
||||
|
||||
TEST(CIniFileClass, IniRegistryTest) {
|
||||
auto const fileName = "test.ini";
|
||||
IniTestHelper helper(fileName, R"(
|
||||
[BuildingTypes]
|
||||
0=GAPOWR
|
||||
1=NAPOWR
|
||||
2=GACNST
|
||||
5=NACNST
|
||||
6=GAPOWR
|
||||
6=NAFAKE
|
||||
|
||||
|
||||
)");
|
||||
|
||||
CIniFile file;
|
||||
ASSERT_EQ(file.LoadFile(std::string(fileName)), 0);
|
||||
|
||||
EXPECT_EQ("NAFAKE", file.GetString("BuildingTypes", "6"));
|
||||
|
||||
auto const& sec = file.GetSection("BuildingTypes");
|
||||
EXPECT_EQ(5, sec.Size());
|
||||
|
||||
EXPECT_EQ("GAPOWR", sec.Nth(0).second);
|
||||
EXPECT_EQ("NAPOWR", sec.Nth(1).second);
|
||||
EXPECT_EQ("GACNST", sec.Nth(2).second);
|
||||
EXPECT_EQ("NACNST", sec.Nth(3).second);
|
||||
EXPECT_EQ("NAFAKE", sec.Nth(4).second);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue