35 #include <gtest/gtest.h> 48 std::istringstream iniFile(R
"ini_file( 73 simConfigDB.load(iniFile); 77 auto ret = simConfigDB.
find(
"General",
"Test2", value);
79 ASSERT_STREQ(value.c_str(),
"bar");
81 ret = simConfigDB.
find(
"Junk",
"Test3", value);
83 ASSERT_STREQ(value.c_str(),
"yo");
85 ret = simConfigDB.
find(
"Junk",
"Test4", value);
87 ASSERT_STREQ(value.c_str(),
"mama mia");
89 ret = simConfigDB.
find(
"General",
"Test1", value);
91 ASSERT_STREQ(value.c_str(),
"BARasdf");
93 ret = simConfigDB.
find(
"General",
"Test3", value);
95 ASSERT_STREQ(value.c_str(),
"89");
98 TEST(Initest, MatchNotFound)
101 simConfigDB.
load(iniFile);
105 auto ret = simConfigDB.
find(
"Junk2",
"test3", value);
108 ret = simConfigDB.
find(
"Junk",
"test4", value);
bool find(const std::string §ion, const std::string &entry, std::string &value) const
Find value corresponding to given section and entry names.
TEST(Initest, MatchFound)
Overload hash function for BasicBlockRange type.
bool load(std::istream &f)
Load parameter settings from given istream.
Declaration of IniFile object.
This class represents the contents of a ".ini" file.