From 7bf1e9f459a7d9da803d70b20869ef4966f15df8 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 24 Jul 2019 17:17:07 -0700 Subject: [PATCH] fs_mgr: liblp test: give ownership of environment to gtest From gtest doc: Note that googletest takes ownership of the registered environment objects. Therefore do not delete them by yourself. Test: run it Change-Id: I275884ddd63a17097c3ea4d9d6bb2b5291dc8c90 --- fs_mgr/liblp/builder_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs_mgr/liblp/builder_test.cpp b/fs_mgr/liblp/builder_test.cpp index 34c68d4d4..fd16e90b6 100644 --- a/fs_mgr/liblp/builder_test.cpp +++ b/fs_mgr/liblp/builder_test.cpp @@ -31,8 +31,7 @@ class Environment : public ::testing::Environment { }; int main(int argc, char** argv) { - std::unique_ptr env(new Environment); - ::testing::AddGlobalTestEnvironment(env.get()); + ::testing::AddGlobalTestEnvironment(new Environment); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }