test: replace fake and duplicate tests with real assertions
Fake tests rewritten to assert real behavior: - audio_smoke: conversion tests now actually Convert() samples and verify output; waveform length/summary assertions tightened to exact values - plugin_format_conversion: RowBytes/U8ToU16/LoadImageFile now call real production code (VideoParams::GetBytesPerPixel, sws scaler, OIIO decode of tests/img.png with known pixel values) - core_color: HSV round trip now verifies fromHsv(toHsv(c)) == c instead of comparing toHsv against its own accessors - core_bezier/node_inputimmediate: expected values replaced with independently derived constants instead of re-running the code under test - common_commandlineparser/common_debug/common_jobtime: capture stdout/stderr/qDebug and assert actual output content - proxy_manager: ProxyFinished test now drives a real proxy job instead of emitting the signal itself; proxy_dialog/panel/proxy/preferences/timeruler tests assert real widget state - viewer_smoke/preview_autocacher/render_misc: zero-assertion tests given observable-state assertions or removed where nothing is observable Duplicates removed: - plugin_smoke_test.cpp: 18 tests duplicated from plugin_paraminstance / plugin_support_* / plugin_renderer_readback (751 -> 180 lines) - module_smoke HumanStrings tests covered precisely by ui_humanstrings_test - render_misc duplicate kDefaultInterpolation constant check Removed by policy (skip allowed, never disabled): - all DISABLED_ prefixes: re-enabled as real offscreen tests or deleted - ffmpeg_decoder_hw: hardcoded personal path replaced with OAK_TEST_HW_DECODE_FILE env var, GTEST_SKIP when unset Also: - config_test: restore Config defaults after run (cross-test pollution) - render_worker_footage: drop /tmp debug-output scaffolding - previewaudiodevice construction test asserts the real bugfix
This commit is contained in:
@@ -51,21 +51,50 @@ TEST(TimelineCoordinate, CopyAndAssignment)
|
||||
|
||||
TEST(TimelineCoordinate, Equality)
|
||||
{
|
||||
olive::TimelineCoordinate a(olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo,
|
||||
1));
|
||||
olive::TimelineCoordinate b(olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo,
|
||||
1));
|
||||
olive::TimelineCoordinate c(olive::core::rational(6, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo,
|
||||
1));
|
||||
olive::TimelineCoordinate d(olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kAudio,
|
||||
1));
|
||||
// TimelineCoordinate provides no operator== of its own; equality is
|
||||
// observable through the real operators of its components (rational and
|
||||
// Track::Reference)
|
||||
const olive::TimelineCoordinate a(
|
||||
olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo, 1));
|
||||
|
||||
EXPECT_EQ(a.GetFrame(), b.GetFrame());
|
||||
EXPECT_EQ(a.GetTrack(), b.GetTrack());
|
||||
EXPECT_NE(a.GetFrame(), c.GetFrame());
|
||||
EXPECT_NE(a.GetTrack(), d.GetTrack());
|
||||
// Distinct objects with identical frame and track compare equal in both
|
||||
// components
|
||||
const olive::TimelineCoordinate b(
|
||||
olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo, 1));
|
||||
EXPECT_TRUE(a.GetFrame() == b.GetFrame());
|
||||
EXPECT_TRUE(a.GetTrack() == b.GetTrack());
|
||||
EXPECT_FALSE(a.GetFrame() != b.GetFrame());
|
||||
EXPECT_FALSE(a.GetTrack() != b.GetTrack());
|
||||
|
||||
// A different frame breaks frame equality while the track stays equal
|
||||
const olive::TimelineCoordinate c(
|
||||
olive::core::rational(6, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo, 1));
|
||||
EXPECT_FALSE(a.GetFrame() == c.GetFrame());
|
||||
EXPECT_TRUE(a.GetFrame() != c.GetFrame());
|
||||
EXPECT_TRUE(a.GetTrack() == c.GetTrack());
|
||||
|
||||
// A different track type or index breaks track equality while the frame
|
||||
// stays equal
|
||||
const olive::TimelineCoordinate d(
|
||||
olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kAudio, 1));
|
||||
const olive::TimelineCoordinate e(
|
||||
olive::core::rational(5, 1),
|
||||
olive::Track::Reference(olive::Track::kVideo, 2));
|
||||
EXPECT_TRUE(a.GetTrack() != d.GetTrack());
|
||||
EXPECT_FALSE(a.GetTrack() == d.GetTrack());
|
||||
EXPECT_TRUE(a.GetTrack() != e.GetTrack());
|
||||
EXPECT_TRUE(a.GetFrame() == d.GetFrame());
|
||||
EXPECT_TRUE(a.GetFrame() == e.GetFrame());
|
||||
|
||||
// Mutating a copy breaks equality with the original
|
||||
olive::TimelineCoordinate mutated = a;
|
||||
mutated.SetFrame(olive::core::rational(7, 1));
|
||||
EXPECT_TRUE(mutated.GetFrame() != a.GetFrame());
|
||||
mutated.SetFrame(olive::core::rational(5, 1));
|
||||
mutated.SetTrack(olive::Track::Reference(olive::Track::kSubtitle, 0));
|
||||
EXPECT_TRUE(mutated.GetTrack() != a.GetTrack());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user