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

Function TEST

tests/ts-bugfix.cpp:4–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "gtest/gtest.h"
3
4TEST(TestBugFix, TestEmptySection) {
5 CSimpleIniA ini;
6 ini.SetValue("foo", "skey", "sval");
7 ini.SetValue("", "rkey", "rval");
8 ini.SetValue("bar", "skey", "sval");
9
10 std::string output;
11 ini.Save(output);
12
13 std::string expected = "rkey = rval\n"
14 "\n"
15 "\n"
16 "[foo]\n"
17 "skey = sval\n"
18 "\n"
19 "\n"
20 "[bar]\n"
21 "skey = sval\n";
22
23 output.erase(std::remove(output.begin(), output.end(), '\r'), output.end());
24 ASSERT_STREQ(expected.c_str(), output.c_str());
25}
26
27TEST(TestBugFix, TestMultiLineIgnoreTrailSpace0) {
28 std::string input = "; multiline values\n"

Callers

nothing calls this directly

Calls 3

SetValueMethod · 0.80
SaveMethod · 0.45
LoadDataMethod · 0.45

Tested by

no test coverage detected