MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / TEST_F

Function TEST_F

test/tests/IniReaderTest.cpp:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28static auto Enum_Currency = ConfigEnum<int32_t>({});
29
30TEST_F(IniReaderTest, create_empty)
31{
32 OpenRCT2::MemoryStream ms(0);
33 ASSERT_EQ(ms.CanRead(), true);
34 ASSERT_EQ(ms.CanWrite(), true);
35 auto ir = CreateIniReader(&ms);
36 ASSERT_NE(ir, nullptr);
37 ASSERT_EQ(ir->GetBoolean("nobody", true), true);
38 ASSERT_EQ(ir->GetString("expects", ""), "");
39 ASSERT_EQ(ir->GetEnum<int32_t>("spanish", 12345, Enum_Currency), 12345);
40 ASSERT_EQ(ir->GetFloat("inquisition", 1.234f), 1.234f);
41 ASSERT_EQ(ir->GetInt32("universal_answer", 42), 42);
42 ASSERT_EQ(
43 ir->GetInt64("heat_death_of_the_universe", std::numeric_limits<int64_t>::max()), std::numeric_limits<int64_t>::max());
44}
45
46TEST_F(IniReaderTest, read_prepared)
47{

Callers

nothing calls this directly

Calls 10

CreateIniReaderFunction · 0.85
CanReadMethod · 0.45
CanWriteMethod · 0.45
GetBooleanMethod · 0.45
GetStringMethod · 0.45
GetFloatMethod · 0.45
GetInt32Method · 0.45
GetInt64Method · 0.45
sizeMethod · 0.45
ReadSectionMethod · 0.45

Tested by

no test coverage detected