Files
oak-editor/tests/gtest/CMakeLists.txt
T
Mike-Solar c203ce1dbf fix: black preview when footage connects directly to a clip
ClipBlock::kBufferIn is declared as NodeValue::kNone with no value
hint, so when a footage node is connected straight to a clip's buffer
input (no effect node in between), the traverser has no type to look
up in the footage's value table and falls back to its last entry. A
footage pushes its video texture first and its audio samples last, so
a video clip ended up fed with audio samples, produced no texture and
the preview went silently black. With any node in between, the table
only carries the passthrough texture, which is why the bug only showed
on direct connections.

Make Node::GetValueHintForInput virtual and override it in ClipBlock
to prefer the value type matching the clip's track (kTexture on video
tracks, kSamples on audio tracks).

Regression tests cover the exact application render path
(PreviewAutoCacher -> RenderManager -> RenderWorkerPool ->
oak-render-worker) for both the direct and indirect cases, the hint
following the track type, and viewer display widgets. The direct-case
test reproduces the black frame without the fix and passes with it.
Full suite: 584 passed.
2026-07-16 01:06:24 +08:00

131 lines
3.2 KiB
CMake

add_executable(olive-gtest
main.cpp
common_current_test.cpp
common_xmlutils_test.cpp
common_range_test.cpp
common_filefunctions_test.cpp
common_qtutils_test.cpp
common_commandlineparser_test.cpp
common_debug_test.cpp
common_decibel_test.cpp
common_digit_test.cpp
common_jobtime_test.cpp
common_ffmpegutils_test.cpp
ffmpeg_bridge_test.cpp
config_test.cpp
audio_level_meter_test.cpp
audio_synchronizer_test.cpp
audio_waveform_sync_test.cpp
color_lut_test.cpp
node_value_test.cpp
node_keyframe_test.cpp
node_serialization_test.cpp
node_globals_test.cpp
node_project_test.cpp
render_videoparams_test.cpp
core_stringutils_test.cpp
core_timecode_test.cpp
core_timerange_test.cpp
core_bezier_test.cpp
core_color_test.cpp
core_rational_test.cpp
core_samplebuffer_test.cpp
render_videoparams_branch_test.cpp
render_audioparams_test.cpp
render_audioparams_branch_test.cpp
render_sampleformat_test.cpp
render_pixelformat_test.cpp
render_loopmode_test.cpp
render_alphaassoc_test.cpp
render_ipc_test.cpp
render_ticket_test.cpp
render_worker_footage_test.cpp
render_direct_connection_test.cpp
render_clip_buffer_hint_test.cpp
viewer_display_repro_test.cpp
project_serializer_test.cpp
proxy_manager_test.cpp
timeline_marker_test.cpp
undo_stack_test.cpp
plugin_support_test.cpp
plugin_support_image_test.cpp
plugin_support_clip_test.cpp
plugin_support_param_test.cpp
plugin_smoke_test.cpp
plugin_ofx_misc_test.cpp
plugin_format_conversion_test.cpp
audio_smoke_test.cpp
viewer_smoke_test.cpp
dynamic_render_backend_test.cpp
opengl_readback_guard_test.cpp
plugin_render_pipeline_test.cpp
plugin_renderer_readback_test.cpp
plugin_ofx_integration_test.cpp
preferences_behavior_tab_test.cpp
node_view_test.cpp
preview_autocacher_test.cpp
codec_frame_test.cpp
codec_decoder_test.cpp
ffmpeg_decoder_hw_test.cpp
codec_exportcodec_test.cpp
codec_exportformat_test.cpp
codec_encoder_test.cpp
task_taskmanager_test.cpp
module_smoke_test.cpp
shader_resources_test.cpp
timecode_metadata_test.cpp
timebased_widget_test.cpp
timeline_coordinate_test.cpp
timeline_waveform_sync_test.cpp
timeline_workarea_test.cpp
)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Test)
target_sources(olive-gtest PRIVATE $<TARGET_OBJECTS:libolive-editor>)
target_include_directories(
olive-gtest
PRIVATE
${CMAKE_SOURCE_DIR}/app
${CMAKE_SOURCE_DIR}/tests
${CMAKE_SOURCE_DIR}/third_party/openfx/include
${CMAKE_SOURCE_DIR}/third_party/openfx/HostSupport/include
${OLIVE_INCLUDE_DIRS}
)
target_link_libraries(
olive-gtest
PRIVATE
${OLIVE_LIBRARIES}
GTest::gtest
Qt${QT_VERSION_MAJOR}::Test
)
target_compile_definitions(
olive-gtest
PRIVATE
${OLIVE_DEFINITIONS}
OAK_TEST_SOURCE_DIR="${CMAKE_SOURCE_DIR}"
)
target_compile_options(
olive-gtest
PRIVATE
${OLIVE_COMPILE_OPTIONS}
)
if (OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
target_compile_definitions(olive-gtest PRIVATE OAK_ENABLE_DYNAMIC_RENDER_BACKEND)
add_dependencies(olive-gtest oakgl)
if (TARGET oakvulkan)
add_dependencies(olive-gtest oakvulkan)
endif()
endif()
if (MSVC)
add_test("Olive.gtest" olive-gtest)
else()
add_test(olive-gtest olive-gtest)
endif()