summaryrefslogtreecommitdiffstats
path: root/test/test_config_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_config_parser.cpp')
-rw-r--r--test/test_config_parser.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/test/test_config_parser.cpp b/test/test_config_parser.cpp
index 1c902d2..99effad 100644
--- a/test/test_config_parser.cpp
+++ b/test/test_config_parser.cpp
@@ -1,14 +1,14 @@
-#include <gtest/gtest.h>
+#include "config.h"
#include "config_parser.hpp"
-
#include "xyz/openbmc_project/Common/error.hpp"
-#include <phosphor-logging/elog-errors.hpp>
-#include "config.h"
#include <exception>
-#include <stdexcept>
#include <fstream>
+#include <phosphor-logging/elog-errors.hpp>
+#include <stdexcept>
+
+#include <gtest/gtest.h>
namespace phosphor
{
@@ -17,31 +17,31 @@ namespace network
class TestConfigParser : public testing::Test
{
- public:
- config::Parser parser;
- TestConfigParser()
- {
- remove("/tmp/eth0.network");
- std::ofstream filestream("/tmp/eth0.network");
+ public:
+ config::Parser parser;
+ TestConfigParser()
+ {
+ remove("/tmp/eth0.network");
+ std::ofstream filestream("/tmp/eth0.network");
- filestream << "[Match]\nName=eth0\n" <<
- "[Network]\nDHCP=true\n[DHCP]\nClientIdentifier= mac\n";
- filestream.close();
- parser.setFile("/tmp/eth0.network");
- }
+ filestream << "[Match]\nName=eth0\n"
+ << "[Network]\nDHCP=true\n[DHCP]\nClientIdentifier= mac\n";
+ filestream.close();
+ parser.setFile("/tmp/eth0.network");
+ }
- bool isValueFound(const std::vector<std::string>& values,
- const std::string& expectedValue)
+ bool isValueFound(const std::vector<std::string>& values,
+ const std::string& expectedValue)
+ {
+ for (const auto& value : values)
{
- for (const auto& value : values)
+ if (expectedValue == value)
{
- if (expectedValue == value)
- {
- return true;
- }
+ return true;
}
- return false;
}
+ return false;
+ }
};
TEST_F(TestConfigParser, ReadConfigDataFromFile)
@@ -82,5 +82,5 @@ TEST_F(TestConfigParser, KeyNotFound)
remove("/tmp/eth0.network");
}
-}//namespace network
-}//namespace phosphor
+} // namespace network
+} // namespace phosphor
OpenPOWER on IntegriCloud