32#include <gtest/gtest.h>
45std::istringstream iniFile(R
"ini_file(
70 simConfigDB.load(iniFile);
74 auto ret = simConfigDB.
find(
"General",
"Test2", value);
76 ASSERT_STREQ(value.c_str(),
"bar");
78 ret = simConfigDB.
find(
"Junk",
"Test3", value);
80 ASSERT_STREQ(value.c_str(),
"yo");
82 ret = simConfigDB.
find(
"Junk",
"Test4", value);
84 ASSERT_STREQ(value.c_str(),
"mama mia");
86 ret = simConfigDB.
find(
"General",
"Test1", value);
88 ASSERT_STREQ(value.c_str(),
"BARasdf");
90 ret = simConfigDB.
find(
"General",
"Test3", value);
92 ASSERT_STREQ(value.c_str(),
"89");
95TEST(Initest, MatchNotFound)
98 simConfigDB.
load(iniFile);
102 auto ret = simConfigDB.
find(
"Junk2",
"test3", value);
105 ret = simConfigDB.
find(
"Junk",
"test4", value);
This class represents the contents of a ".ini" file.
bool find(const std::string §ion, const std::string &entry, std::string &value) const
Find value corresponding to given section and entry names.
bool load(std::istream &f)
Load parameter settings from given istream.
Declaration of IniFile object.
TEST(Initest, MatchFound)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.