Hi Vlad, Others,
Sorry for resurrecting a necro-thread here.
The project I'm working on faced a similar issue (we unload DLLs (containing individual tests) manually, and Google Test used to crash at the application's exit).
Our solution is to add the following to gtest.h:
inline void CLEAN_TESTS() {
::testing::UnitTest::GetInstance()->Clean();
}
and the following to gtest.cc:
void UnitTest::Clean() {
delete impl_;
impl_ = new internal::UnitTestImpl(this);
}
and then call CLEAN_TESTS() before unloading any DLLs.
An unfortunate consequence is that we have to fork and modify GoogleTest's sources -- something we don't want to do.
This was many moons ago (we used gtest1.6, compiled with VS2010); fast forward to today (we use gtest1.8, compiled with VS2013). Now I don't see this problem anymore! -- even after I removed our solution.
Does it mean this use case is supported now?
Yours,
Andrey
вторник, 1 июня 2010 г., 20:01:21 UTC+3 пользователь Vlad Losev написал: