1 #include "gmock/gmock.h" 2 #include "gtest/gtest.h" 4 #include "ParamHandler.hpp" 7 TEST(YAML, yaml_category_read) {
9 EXPECT_TRUE(paramHandler.fileOpenedSuccessfully());
11 std::vector<double> c1p2, c2p2;
12 EXPECT_TRUE(paramHandler.getValue(
"category-1",
"parameter-1", c1p1));
13 EXPECT_TRUE(paramHandler.getValue(
"category-2",
"parameter-1", c2p1));
14 EXPECT_TRUE(paramHandler.getVector(
"category-1",
"parameter-2", c1p2));
15 EXPECT_TRUE(paramHandler.getVector(
"category-2",
"parameter-2", c2p2));
17 EXPECT_TRUE(c1p1 == 12.);
18 EXPECT_TRUE(c1p2[0] == 1.);
19 EXPECT_TRUE(c1p2[1] == 2.);
20 EXPECT_TRUE(c1p2[2] == 3.);
21 EXPECT_TRUE(c1p2.size() == 3);
23 EXPECT_TRUE(c2p1 == 23.);
24 EXPECT_TRUE(c2p2[0] == 2.);
25 EXPECT_TRUE(c2p2[1] == 3.);
26 EXPECT_TRUE(c2p2.size() == 2);
28 EXPECT_FALSE(paramHandler.getValue(
"notARealKey", c1p1));
29 ParamHandler badHandler(
"not-a-real-file.potato");
30 EXPECT_FALSE(badHandler.fileOpenedSuccessfully());
TEST(YAML, yaml_category_read)
std::string getConfigDirectoryPath()