Properly destroy ChrootEnv in env_test

Summary: see title

Test Plan:
  $ /mnt/gvfs/third-party2/valgrind/af85c56f424cd5edfc2c97588299b44ecdec96bb/3.10.0/gcc-4.9-glibc-2.20/e9936bf/bin/valgrind --error-exitcode=2 --leak-check=full ./env_test

Reviewers: IslamAbdelRahman, sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D57897
This commit is contained in:
Andrew Kryczka 2016-05-09 14:38:50 -07:00
parent fca5aa6fcc
commit 258459ed54

View File

@ -1063,9 +1063,10 @@ TEST_P(EnvPosixTestWithParam, WritableFileWrapper) {
INSTANTIATE_TEST_CASE_P(DefaultEnv, EnvPosixTestWithParam,
::testing::Values(Env::Default()));
#if !defined(ROCKSDB_LITE) && !defined(OS_WIN)
static unique_ptr<Env> chroot_env(NewChrootEnv(Env::Default(),
test::TmpDir(Env::Default())));
INSTANTIATE_TEST_CASE_P(ChrootEnv, EnvPosixTestWithParam,
::testing::Values(NewChrootEnv(Env::Default(),
"/tmp")));
::testing::Values(chroot_env.get()));
#endif // !defined(ROCKSDB_LITE) && !defined(OS_WIN)
} // namespace rocksdb