diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/remote_logging_test_config.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/test/remote_logging_test_config.cpp b/test/remote_logging_test_config.cpp index a4c6207..b34a43f 100644 --- a/test/remote_logging_test_config.cpp +++ b/test/remote_logging_test_config.cpp @@ -3,6 +3,19 @@ #include <fstream> #include <string> +#if __has_include(<filesystem>) +#include <filesystem> +#elif __has_include(<experimental/filesystem>) +#include <experimental/filesystem> +namespace std +{ +// splice experimental::filesystem into std +namespace filesystem = std::experimental::filesystem; +} // namespace std +#else +#error filesystem not available +#endif + namespace phosphor { namespace logging @@ -21,13 +34,13 @@ std::string getConfig(const char* filePath) TEST_F(TestRemoteLogging, testOnlyAddress) { config->address("1.1.1.1"); - EXPECT_EQ(getConfig(configFilePath.c_str()), "#*.* @@remote-host:port"); + EXPECT_EQ(fs::exists(configFilePath.c_str()), false); } TEST_F(TestRemoteLogging, testOnlyPort) { config->port(100); - EXPECT_EQ(getConfig(configFilePath.c_str()), "#*.* @@remote-host:port"); + EXPECT_EQ(fs::exists(configFilePath.c_str()), false); } TEST_F(TestRemoteLogging, testGoodConfig) @@ -43,7 +56,7 @@ TEST_F(TestRemoteLogging, testClearAddress) config->port(100); EXPECT_EQ(getConfig(configFilePath.c_str()), "*.* @@1.1.1.1:100"); config->address(""); - EXPECT_EQ(getConfig(configFilePath.c_str()), "#*.* @@remote-host:port"); + EXPECT_EQ(fs::exists(configFilePath.c_str()), false); } TEST_F(TestRemoteLogging, testClearPort) @@ -52,7 +65,7 @@ TEST_F(TestRemoteLogging, testClearPort) config->port(100); EXPECT_EQ(getConfig(configFilePath.c_str()), "*.* @@1.1.1.1:100"); config->port(0); - EXPECT_EQ(getConfig(configFilePath.c_str()), "#*.* @@remote-host:port"); + EXPECT_EQ(fs::exists(configFilePath.c_str()), false); } } // namespace test |