Resolve Meson issues
This commit includes fixes in the repo:
1. Moving experimental filesystem to filesystem
2. Errors that meson identified
Signed-off-by: Ratan Gupta <ratankgupta31@gmail.com>
Change-Id: I93c77c2a434275c4da3ca4549919eaa55b57f481
diff --git a/test/test_snmp_client.cpp b/test/test_snmp_client.cpp
index 1dd9eb4..698c491 100644
--- a/test/test_snmp_client.cpp
+++ b/test/test_snmp_client.cpp
@@ -22,12 +22,11 @@
public:
sdbusplus::bus::bus bus;
ConfManager manager;
- std::string confDir;
TestSNMPClient() :
bus(sdbusplus::bus::new_default()), manager(bus, mgrObjPath)
{
char tmp[] = "/tmp/snmpClient.XXXXXX";
- std::string confDir = mkdtemp(tmp);
+ auto confDir = mkdtemp(tmp);
manager.dbusPersistentLocation = confDir;
}
diff --git a/test/test_snmp_conf_manager.cpp b/test/test_snmp_conf_manager.cpp
index bcf89e7..de89272 100644
--- a/test/test_snmp_conf_manager.cpp
+++ b/test/test_snmp_conf_manager.cpp
@@ -21,12 +21,16 @@
public:
sdbusplus::bus::bus bus;
ConfManager manager;
+ // confDir could have been created locally in the
+ // TestSNMPConfManager but somehow that is leading
+ // to segmentation fault while running the unit test.
+ // TODO: https://github.com/openbmc/phosphor-snmp/issues/5
std::string confDir;
TestSNMPConfManager() :
bus(sdbusplus::bus::new_default()), manager(bus, managerObjPath)
{
char tmp[] = "/tmp/snmpManager.XXXXXX";
- std::string confDir = mkdtemp(tmp);
+ confDir = mkdtemp(tmp);
manager.dbusPersistentLocation = confDir;
}
diff --git a/test/test_snmp_serialize.cpp b/test/test_snmp_serialize.cpp
index 1b0928e..627045b 100644
--- a/test/test_snmp_serialize.cpp
+++ b/test/test_snmp_serialize.cpp
@@ -4,7 +4,7 @@
#include <netinet/in.h>
-#include <experimental/filesystem>
+#include <filesystem>
#include <fstream>
#include <gtest/gtest.h>
@@ -17,7 +17,7 @@
{
constexpr auto clientObjPath = "/xyz/openbmc_test/snmp/client";
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
class TestSerialize : public testing::Test
{