mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-05 06:00:29 -04:00
implemented UT project using google test .
This commit is contained in:
parent
9235ac60c1
commit
1f2da14f89
6 changed files with 309 additions and 0 deletions
24
UnitTest/CIni_Test.cpp
Normal file
24
UnitTest/CIni_Test.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#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"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue