fix: remaining issues recorded during test coverage work
- RenderManager: GPU-side members (context_, decoder_cache_, shader_cache_, auto_cacher_, worker_pool_, decoder_clear_timer_) were left uninitialized when the configured graphics backend is unknown (e.g. dummy); ViewerWidget then dereferenced garbage and crashed. Initialize them at declaration - CurveView::SelectKeyframesOfInput ignored its reference parameter and selected keyframes of every connected track; select only the requested track's keyframes - SeekableWidget::SeekToScenePoint dereferenced GetViewerNode() unconditionally; skip the playhead update when no viewer is connected - LoadOTIOTask: unknown root schema leaked the freshly allocated project_ (delete + reset; OTIO is not enabled in local builds so this file is compile-verified by inspection only) Locked by new tests: RenderManagerDummyBackend, TimeRuler.SeekToScenePointWithoutViewerIsNoOp, CurveViewTest.SelectKeyframesOfInputSelectsOnlyRequestedTrack
This commit is contained in:
@@ -712,3 +712,22 @@ TEST_F(RenderMiscAutoCacherTest, CacheProxyTaskCancelledClearsPendingJobs)
|
||||
|
||||
cacher.SetProject(nullptr);
|
||||
}
|
||||
|
||||
// With an unknown/dummy graphics backend the RenderManager never creates the
|
||||
// GPU-side objects. Those pointers must be null (previously they were left
|
||||
// uninitialized, so callers such as ViewerWidget dereferenced garbage and
|
||||
// crashed).
|
||||
TEST(RenderManagerDummyBackend, GpuMembersAreNullRatherThanUninitialized)
|
||||
{
|
||||
const QVariant previous =
|
||||
olive::Config::Current()[QStringLiteral("GraphicsBackend")];
|
||||
olive::Config::Current()[QStringLiteral("GraphicsBackend")] =
|
||||
QStringLiteral("dummy");
|
||||
|
||||
olive::RenderManager::CreateInstance();
|
||||
|
||||
EXPECT_EQ(olive::RenderManager::instance()->GetCacher(), nullptr);
|
||||
|
||||
olive::RenderManager::DestroyInstance();
|
||||
olive::Config::Current()[QStringLiteral("GraphicsBackend")] = previous;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user