namespace {
-testing::Environment *env = nullptr;
+smoke_test::SmokeEnvironment *env = nullptr;
void signalHandler(int signum) {
env->TearDown();
exit(signum);
}
-smoke_test::SmokeEnvironment *dcast(testing::Environment* _env) {
- return dynamic_cast<smoke_test::SmokeEnvironment *>(_env);
-}
-
} // namespace
namespace smoke_test {
class SmokeTest : public testing::Test {
public:
- SmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)),
+ SmokeTest() : backend(std::to_string(env->test_user.uid)),
params{PackageType::WGT, false} {
- params.test_user.uid = dcast(env)->test_user.uid;
- params.test_user.gid = dcast(env)->test_user.gid;
+ params.test_user.uid = env->test_user.uid;
+ params.test_user.gid = env->test_user.gid;
}
protected:
WgtBackendInterface backend;
class HybridSmokeTest : public testing::Test {
public:
- HybridSmokeTest() : backend(std::to_string(dcast(env)->test_user.uid)),
+ HybridSmokeTest() : backend(std::to_string(env->test_user.uid)),
params{PackageType::HYBRID, false} {
- params.test_user.uid = dcast(env)->test_user.uid;
- params.test_user.gid = dcast(env)->test_user.gid;
+ params.test_user.uid = env->test_user.uid;
+ params.test_user.gid = env->test_user.gid;
}
protected:
HybridBackendInterface backend;
::testing::GTEST_FLAG(filter) = "SmokeTest.*";
}
testing::InitGoogleTest(&argc, argv);
- ::env = testing::AddGlobalTestEnvironment(
- new smoke_test::SmokeEnvironment(request_mode));
+ ::env = static_cast<smoke_test::SmokeEnvironment*>(
+ testing::AddGlobalTestEnvironment(
+ new smoke_test::SmokeEnvironment(request_mode)));
signal(SIGINT, ::signalHandler);
signal(SIGSEGV, ::signalHandler);
return RUN_ALL_TESTS();