MCPcopy Create free account
hub / github.com/brofield/simpleini / TEST_F

Function TEST_F

tests/ts-numeric.cpp:18–35  ·  view source on GitHub ↗

Test GetLongValue with valid integers

Source from the content-addressed store, hash-verified

16
17// Test GetLongValue with valid integers
18TEST_F(TestNumeric, TestGetLongValuePositive) {
19 std::string input = "[numbers]\n"
20 "positive = 42\n"
21 "zero = 0\n"
22 "negative = -123\n";
23
24 SI_Error rc = ini.LoadData(input);
25 ASSERT_EQ(rc, SI_OK);
26
27 long result = ini.GetLongValue("numbers", "positive", 0);
28 ASSERT_EQ(result, 42);
29
30 result = ini.GetLongValue("numbers", "zero", -1);
31 ASSERT_EQ(result, 0);
32
33 result = ini.GetLongValue("numbers", "negative", 0);
34 ASSERT_EQ(result, -123);
35}
36
37// Test GetLongValue with hex values
38TEST_F(TestNumeric, TestGetLongValueHex) {

Callers

nothing calls this directly

Calls 9

GetLongValueMethod · 0.80
SetLongValueMethod · 0.80
GetDoubleValueMethod · 0.80
SetDoubleValueMethod · 0.80
SetMultiKeyMethod · 0.80
GetAllValuesMethod · 0.80
SetUnicodeMethod · 0.80
LoadDataMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected