phosphor-ipmi-flash: Fix all C++ warnings

Change-Id: I89236b2dab88ca725e269bb8f5b2cbfd271e807a
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/bmc/firmware-handler/test/firmware_json_unittest.cpp b/bmc/firmware-handler/test/firmware_json_unittest.cpp
index 9e562c6..4dde694 100644
--- a/bmc/firmware-handler/test/firmware_json_unittest.cpp
+++ b/bmc/firmware-handler/test/firmware_json_unittest.cpp
@@ -4,6 +4,8 @@
 
 #include <nlohmann/json.hpp>
 
+#include <filesystem>
+
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
@@ -13,7 +15,7 @@
 {
 using ::testing::IsEmpty;
 
-static constexpr auto TESTFNAME = "test.json";
+static constexpr auto TESTFNAME = "./test/test.json";
 using json = nlohmann::json;
 TEST(FirmwareJsonTest, InvalidHandlerType)
 {
@@ -617,6 +619,7 @@
 
 TEST(FirmwareJsonTest, BuildFromFile)
 {
+    std::filesystem::create_directories("./test/");
     std::ofstream testfile;
     testfile.open(TESTFNAME, std::ios::out);
     auto good = R"(
@@ -642,7 +645,7 @@
     testfile << good.dump(4);
     testfile.flush();
     FirmwareHandlersBuilder b;
-    auto h = b.buildHandlerConfigs("./");
+    auto h = b.buildHandlerConfigs("./test/");
     EXPECT_EQ(h.size(), 1);
     EXPECT_EQ(h[0].blobId, "/flash/image");
     EXPECT_FALSE(h[0].handler == nullptr);
@@ -658,12 +661,13 @@
 
 TEST(FirmwareJsonTest, BuildFromBadFile)
 {
+    std::filesystem::create_directories("./test/");
     std::ofstream testfile;
     testfile.open(TESTFNAME, std::ios::out);
     testfile << "{] a malformed json {{";
     testfile.flush();
     FirmwareHandlersBuilder b;
-    auto h = b.buildHandlerConfigs("./");
+    auto h = b.buildHandlerConfigs("./test/");
     EXPECT_THAT(h, IsEmpty());
     if (std::remove(TESTFNAME) != 0)
     {