CNC_TS_and_RA2_Mission_Editor/UnitTest/CIni_Test.cpp
2024-04-11 23:03:40 -04:00

24 lines
No EOL
687 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "stdafx.h"
#include "../MissionEditor/IniFile.h"
TEST(CIniFileClass, LoadFileTest) {
auto const iniContent = R"(
[Debug]
;DisplayAllOverlay=Yes ; Doesn´t cripple the overlay list in any way
;EnableTrackLogic=Yes ; Enables Track Logic
;IgnoreSHPImageHeadUnused=Yes ; Use this *carefully* to make SHP graphics of some mods work that incorrectly have the shadow flag set
AllowTunnels=yes
AllowUnidirectionalTunnels=yes
)";
auto const testIni = "test.ini";
std::ofstream iniFile(testIni);
iniFile << iniContent;
iniFile.flush();
iniFile.close();
CIniFile file;
ASSERT_EQ(file.LoadFile(std::string(testIni)), 0);
EXPECT_EQ(true, file.GetBool("Debug","AllowTunnels"));
}