Add namespaces to erase methods
Some erase objects did not have the required namespace. This change adds
the estoraged and estoraged_testing namespace where it is needed.
Testing: Not tested
Change-Id: I63757ea4d3672659f21108e5e65fd09aa1c03406
Signed-off-by: John Edward Broadbent <jebr@google.com>
diff --git a/src/erase/erase.cpp b/src/erase/erase.cpp
index 5de96d6..6cd45f2 100644
--- a/src/erase/erase.cpp
+++ b/src/erase/erase.cpp
@@ -8,6 +8,9 @@
#include <stdplus/handle/managed.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
+namespace estoraged
+{
+
using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
using stdplus::fd::ManagedFd;
@@ -31,3 +34,5 @@
}
return bytes;
}
+
+} // namespace estoraged
diff --git a/src/erase/pattern.cpp b/src/erase/pattern.cpp
index 6fb08a7..0e510a0 100644
--- a/src/erase/pattern.cpp
+++ b/src/erase/pattern.cpp
@@ -15,6 +15,9 @@
#include <span>
#include <string>
+namespace estoraged
+{
+
constexpr uint32_t seed = 0x6a656272;
constexpr size_t blockSize = 4096;
constexpr size_t blockSizeUsing32 = blockSize / sizeof(uint32_t);
@@ -105,3 +108,5 @@
currentIndex = currentIndex + readSize;
}
}
+
+} // namespace estoraged
diff --git a/src/erase/verifyDriveGeometry.cpp b/src/erase/verifyDriveGeometry.cpp
index ea6c76f..2d223a7 100644
--- a/src/erase/verifyDriveGeometry.cpp
+++ b/src/erase/verifyDriveGeometry.cpp
@@ -7,6 +7,8 @@
#include <string>
+namespace estoraged
+{
using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
void VerifyDriveGeometry::geometryOkay(uint64_t bytes)
@@ -36,3 +38,5 @@
std::string("OpenBMC.0.1.DriveEraseSuccess"));
}
}
+
+} // namespace estoraged
diff --git a/src/test/erase/pattern_test.cpp b/src/test/erase/pattern_test.cpp
index 358f873..98eb374 100644
--- a/src/test/erase/pattern_test.cpp
+++ b/src/test/erase/pattern_test.cpp
@@ -15,6 +15,10 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+namespace estoraged_test
+{
+
+using estoraged::Pattern;
using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
TEST(pattern, patternPass)
@@ -65,3 +69,5 @@
EXPECT_NO_THROW(pass.writePattern(size - sizeof(dummyValue)));
EXPECT_THROW(pass.verifyPattern(size), InternalFailure);
}
+
+} // namespace estoraged_test
diff --git a/src/test/erase/verifyGeometry_test.cpp b/src/test/erase/verifyGeometry_test.cpp
index de4d3fa..8b362f3 100644
--- a/src/test/erase/verifyGeometry_test.cpp
+++ b/src/test/erase/verifyGeometry_test.cpp
@@ -7,6 +7,9 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+namespace estoraged_test
+{
+using estoraged::VerifyDriveGeometry;
using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
TEST(VerifyGeometry, TooBigFail)
@@ -28,3 +31,5 @@
VerifyDriveGeometry passVerify("");
EXPECT_NO_THROW(passVerify.geometryOkay(ERASE_MIN_GEOMETRY + 1));
}
+
+} // namespace estoraged_test