From a99edb5ab521949ee109bba615b43839c7b068fb Mon Sep 17 00:00:00 2001 From: Ziy1-Tan Date: Thu, 23 Nov 2023 09:53:16 +0800 Subject: [PATCH] fix: curvefs/metaserver ut crash when compiling with release mode Signed-off-by: Ziy1-Tan --- curvefs/test/metaserver/storage/dumpfile_test.cpp | 2 ++ curvefs/test/metaserver/storage/iterator_test.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/curvefs/test/metaserver/storage/dumpfile_test.cpp b/curvefs/test/metaserver/storage/dumpfile_test.cpp index ee618e955c..cfa9c8ee11 100644 --- a/curvefs/test/metaserver/storage/dumpfile_test.cpp +++ b/curvefs/test/metaserver/storage/dumpfile_test.cpp @@ -39,6 +39,7 @@ namespace storage { using Hash = std::unordered_map; +namespace { class HashIterator : public Iterator { public: explicit HashIterator(Hash* hash) @@ -56,6 +57,7 @@ class HashIterator : public Iterator { Hash::iterator iter_; Hash* hash_; }; +} // namespace class DumpFileTest : public ::testing::Test { protected: diff --git a/curvefs/test/metaserver/storage/iterator_test.cpp b/curvefs/test/metaserver/storage/iterator_test.cpp index ca76d40c30..f28a4ffcaa 100644 --- a/curvefs/test/metaserver/storage/iterator_test.cpp +++ b/curvefs/test/metaserver/storage/iterator_test.cpp @@ -38,8 +38,8 @@ namespace storage { using Hash = std::unordered_map; using ContainerType = std::map; -using google::protobuf::util::MessageDifferencer; +namespace { class HashIterator : public Iterator { public: explicit HashIterator(Hash* hash) @@ -58,6 +58,7 @@ class HashIterator : public Iterator { Hash* hash_; Hash::iterator iter_; }; +} // namespace class IteratorTest : public ::testing::Test { protected: