From 4594cf85b62b8964c8a57e2720803f6565f36bf8 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Thu, 22 Feb 2024 21:17:24 -0600 Subject: [PATCH] Fix Tracker/ObjectDetector unit tests, due to new default values --- src/TrackedObjectBBox.cpp | 2 +- tests/KeyFrame.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/TrackedObjectBBox.cpp b/src/TrackedObjectBBox.cpp index 8b6381108..0d79a2536 100644 --- a/src/TrackedObjectBBox.cpp +++ b/src/TrackedObjectBBox.cpp @@ -34,7 +34,7 @@ TrackedObjectBBox::TrackedObjectBBox(int Red, int Green, int Blue, int Alfa) : delta_x(0.0), delta_y(0.0), scale_x(1.0), scale_y(1.0), rotation(0.0), background_alpha(0.0), background_corner(12), - stroke_width(2) , stroke_alpha(0.70), + stroke_width(2) , stroke_alpha(0.7), stroke(Red, Green, Blue, Alfa), background(0, 0, 255, Alfa) { diff --git a/tests/KeyFrame.cpp b/tests/KeyFrame.cpp index a7559103f..49a4d2b20 100644 --- a/tests/KeyFrame.cpp +++ b/tests/KeyFrame.cpp @@ -583,10 +583,10 @@ TEST_CASE( "TrackedObjectBBox init", "[libopenshot][keyframe]" ) CHECK(kfb.rotation.GetInt(1) == 0); CHECK(kfb.stroke_width.GetInt(1) == 2); - CHECK(kfb.stroke_alpha.GetInt(1) == 0); + CHECK(kfb.stroke_alpha.GetValue(1) == Approx(0.7f).margin(0.0001)); - CHECK(kfb.background_alpha .GetInt(1)== 1); - CHECK(kfb.background_corner.GetInt(1) == 0); + CHECK(kfb.background_alpha .GetInt(1) == 0); + CHECK(kfb.background_corner.GetInt(1) == 12); CHECK(kfb.stroke.red.GetInt(1) == 62); CHECK(kfb.stroke.green.GetInt(1) == 143); @@ -596,8 +596,7 @@ TEST_CASE( "TrackedObjectBBox init", "[libopenshot][keyframe]" ) CHECK(kfb.background.red.GetInt(1) == 0); CHECK(kfb.background.green.GetInt(1) == 0); CHECK(kfb.background.blue.GetInt(1) == 255); - CHECK(kfb.background.alpha.GetInt(1) == 0); - + CHECK(kfb.background.alpha.GetInt(1) == 212); } TEST_CASE( "TrackedObjectBBox AddBox and RemoveBox", "[libopenshot][keyframe]" )