APP: the init method for the test app already has the _testApp pointer available now

master
Martin Gerhardy 2022-03-30 19:34:53 +02:00
parent 672a3e89c7
commit c6b2229151
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ void AbstractTest::SetUp() {
const core::TimeProviderPtr timeProvider = std::make_shared<core::TimeProvider>();
const metric::MetricPtr& metric = std::make_shared<metric::Metric>();
_testApp = new TestApp(metric, filesystem, eventBus, timeProvider, this);
_testApp->run();
const bool isRunning = _testApp->_curState == AppState::Running;
ASSERT_TRUE(isRunning) << "Failed to setup the test app properly";
}
@ -49,6 +50,9 @@ AbstractTest::TestApp::TestApp(const metric::MetricPtr& metric, const io::Filesy
_initialLogLevel = SDL_LOG_PRIORITY_WARN;
_argc = ::_argc;
_argv = ::_argv;
}
void AbstractTest::TestApp::run() {
while (_curState < AppState::Running) {
core_trace_scoped(AppMainLoop);
onFrame();

View File

@ -21,6 +21,8 @@ private:
TestApp(const metric::MetricPtr& metric, const io::FilesystemPtr& filesystem, const core::EventBusPtr& eventBus, const core::TimeProviderPtr& timeProvider, AbstractTest* test);
virtual ~TestApp();
void run();
app::AppState onInit() override;
app::AppState onCleanup() override;
};