phosphor-ipmi-blobs-binarystore: Code Health Cleanup
Removed the following warning.
- using decl '*' is unused in unit tests
```
binarystore.hpp:58:5: style: Class 'BinaryStore' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
BinaryStore(std::unique_ptr<SysFile> file, bool readOnly = false,
^
test/fake_sys_file.hpp:29:5: style: Class 'FakeSysFile' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
FakeSysFile(const std::string& s) : data_(s)
^
binarystore.cpp:164:16: style: Consider using std::transform algorithm instead of a raw loop. [useStlAlgorithm]
result.push_back(blob.blob_id());
^
test/binarystore_unittest.cpp:50:5: style: Class 'SysFileBuf' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
SysFileBuf(std::string* storage) : data_{storage}
^
test/handler_unittest.cpp:161:35: style: Variable 'staleBaseId' is assigned a value that is never used. [unreadVariable]
const std::string staleBaseId = "/stale/"s;
```
Change-Id: I3f6e10ee3a89ec745a601dc488a75277b33c83fb
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/test/binarystore_unittest.cpp b/test/binarystore_unittest.cpp
index 2a00696..f7c8a8e 100644
--- a/test/binarystore_unittest.cpp
+++ b/test/binarystore_unittest.cpp
@@ -47,7 +47,7 @@
class SysFileBuf : public binstore::SysFile
{
public:
- SysFileBuf(std::string* storage) : data_{storage}
+ explicit SysFileBuf(std::string* storage) : data_{storage}
{
}
diff --git a/test/fake_sys_file.hpp b/test/fake_sys_file.hpp
index eb8d024..1d319f6 100644
--- a/test/fake_sys_file.hpp
+++ b/test/fake_sys_file.hpp
@@ -26,7 +26,7 @@
FakeSysFile()
{
}
- FakeSysFile(const std::string& s) : data_(s)
+ explicit FakeSysFile(const std::string& s) : data_(s)
{
}
diff --git a/test/handler_commit_unittest.cpp b/test/handler_commit_unittest.cpp
index 9a79c36..49bf698 100644
--- a/test/handler_commit_unittest.cpp
+++ b/test/handler_commit_unittest.cpp
@@ -1,11 +1,5 @@
#include "handler_unittest.hpp"
-using ::testing::_;
-using ::testing::ElementsAre;
-using ::testing::IsEmpty;
-using ::testing::Return;
-using ::testing::StartsWith;
-
using namespace std::string_literals;
namespace blobs
diff --git a/test/handler_open_unittest.cpp b/test/handler_open_unittest.cpp
index 5706041..93a3acd 100644
--- a/test/handler_open_unittest.cpp
+++ b/test/handler_open_unittest.cpp
@@ -2,7 +2,6 @@
using ::testing::_;
using ::testing::Return;
-using ::testing::StartsWith;
using ::testing::UnorderedElementsAreArray;
using namespace std::string_literals;
diff --git a/test/handler_readwrite_unittest.cpp b/test/handler_readwrite_unittest.cpp
index 5579499..397ce69 100644
--- a/test/handler_readwrite_unittest.cpp
+++ b/test/handler_readwrite_unittest.cpp
@@ -9,7 +9,6 @@
using ::testing::ElementsAre;
using ::testing::IsEmpty;
using ::testing::Return;
-using ::testing::StartsWith;
using namespace std::string_literals;
using namespace binstore;
diff --git a/test/handler_stat_unittest.cpp b/test/handler_stat_unittest.cpp
index 253d02c..fb59057 100644
--- a/test/handler_stat_unittest.cpp
+++ b/test/handler_stat_unittest.cpp
@@ -2,12 +2,6 @@
#include <gtest/gtest.h>
-using ::testing::_;
-using ::testing::ElementsAre;
-using ::testing::IsEmpty;
-using ::testing::Return;
-using ::testing::StartsWith;
-
using namespace std::string_literals;
namespace blobs
diff --git a/test/handler_unittest.cpp b/test/handler_unittest.cpp
index 29420f6..37b16b1 100644
--- a/test/handler_unittest.cpp
+++ b/test/handler_unittest.cpp
@@ -17,11 +17,8 @@
using ::testing::_;
using ::testing::AtLeast;
-using ::testing::ElementsAreArray;
-using ::testing::IsEmpty;
using ::testing::Return;
using ::testing::StrEq;
-using ::testing::StrNe;
using ::testing::UnorderedElementsAreArray;
using namespace std::string_literals;
@@ -161,7 +158,6 @@
})";
// Create sysfile containing a valid but stale blob
- const std::string staleBaseId = "/stale/"s;
const std::string staleBlobId = "/stale/blob"s;
binaryblobproto::BinaryBlobBase staleBlob;
EXPECT_TRUE(TextFormat::ParseFromString(basicTestStaleBlobStr, &staleBlob));
diff --git a/test/sys_file_unittest.cpp b/test/sys_file_unittest.cpp
index f66cefd..7293e2b 100644
--- a/test/sys_file_unittest.cpp
+++ b/test/sys_file_unittest.cpp
@@ -12,8 +12,6 @@
using namespace std::string_literals;
using ::testing::_;
-using ::testing::Args;
-using ::testing::Ge;
using ::testing::IsEmpty;
using ::testing::NotNull;
using ::testing::Return;