From 6a73e5a7207393adfc93c0084de3ace15d772df2 Mon Sep 17 00:00:00 2001 From: Trutnev Aleksei Date: Fri, 29 Oct 2021 19:30:35 +0300 Subject: [PATCH] Merge pull request #20922 from alexgiving:atrutnev/align_expect_assert_macros GAPI: Align EXPECT/ASSERT macros * Align TEST macros * restart CI * Fix ASSERT_GT in gapi_async_test --- .../gapi/test/common/gapi_core_tests_inl.hpp | 56 ++++++------- .../test/common/gapi_imgproc_tests_inl.hpp | 80 +++++++++---------- .../test/common/gapi_operators_tests_inl.hpp | 6 +- modules/gapi/test/gapi_opaque_tests.cpp | 16 ++-- .../gapi/test/infer/gapi_infer_onnx_test.cpp | 2 +- .../test/internal/gapi_int_gmetaarg_test.cpp | 2 +- modules/gapi/test/own/conc_queue_tests.cpp | 2 +- .../test/own/last_written_value_tests.cpp | 2 +- modules/gapi/test/own/mat_tests.cpp | 78 +++++++++--------- modules/gapi/test/own/scalar_tests.cpp | 18 ++--- .../test/streaming/gapi_streaming_tests.cpp | 4 +- .../gapi_streaming_vpl_core_test.cpp | 70 ++++++++-------- modules/gapi/test/util/any_tests.cpp | 30 +++---- modules/gapi/test/util/variant_tests.cpp | 42 +++++----- 14 files changed, 204 insertions(+), 204 deletions(-) diff --git a/modules/gapi/test/common/gapi_core_tests_inl.hpp b/modules/gapi/test/common/gapi_core_tests_inl.hpp index d9287a176c..09b61e2876 100644 --- a/modules/gapi/test/common/gapi_core_tests_inl.hpp +++ b/modules/gapi/test/common/gapi_core_tests_inl.hpp @@ -138,7 +138,7 @@ TEST_P(MathOpTest, MatricesAccuracyTest) #else EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); #endif - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -173,7 +173,7 @@ TEST_P(MulDoubleTest, AccuracyTest) #else EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); #endif - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } TEST_P(DivTest, DISABLED_DivByZeroTest) // https://github.com/opencv/opencv/pull/12826 @@ -195,7 +195,7 @@ TEST_P(DivTest, DISABLED_DivByZeroTest) // https://github.com/opencv/opencv/pul // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -304,7 +304,7 @@ TEST_P(Polar2CartTest, AccuracyTest) // // TODO: Make threshold a configurable parameter of this test (ADE-221) - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); cv::Mat &outx = out_mat_gapi, &outy = out_mat2; @@ -347,7 +347,7 @@ TEST_P(Cart2PolarTest, AccuracyTest) // // TODO: Make threshold a configurable parameter of this test (ADE-221) - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); cv::Mat &outm = out_mat_gapi, &outa = out_mat2; @@ -406,7 +406,7 @@ TEST_P(CmpTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); } } @@ -464,7 +464,7 @@ TEST_P(BitwiseTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); } } @@ -484,7 +484,7 @@ TEST_P(NotTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); } } @@ -508,7 +508,7 @@ TEST_P(SelectTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); } } @@ -528,7 +528,7 @@ TEST_P(MinTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); } } @@ -548,7 +548,7 @@ TEST_P(MaxTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); } } @@ -568,7 +568,7 @@ TEST_P(AbsDiffTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); } } @@ -589,7 +589,7 @@ TEST_P(AbsDiffCTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); } } @@ -659,7 +659,7 @@ TEST_P(AddWeightedTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } TEST_P(NormTest, AccuracyTest) @@ -738,7 +738,7 @@ TEST_P(ThresholdTest, AccuracyTestBinary) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cv::norm(out_mat_ocv, out_mat_gapi, NORM_L1)); } } @@ -764,7 +764,7 @@ TEST_P(ThresholdOTTest, AccuracyTestOtsu) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(ocv_res, out_gapi_scalar.val[0]); } } @@ -788,7 +788,7 @@ TEST_P(InRangeTest, AccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); } } @@ -992,7 +992,7 @@ TEST_P(RemapTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1011,7 +1011,7 @@ TEST_P(FlipTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1037,7 +1037,7 @@ TEST_P(CropTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_out); + EXPECT_EQ(sz_out, out_mat_gapi.size()); } } @@ -1063,7 +1063,7 @@ TEST_P(CopyTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz_out); + EXPECT_EQ(sz_out, out_mat_gapi.size()); } } @@ -1245,7 +1245,7 @@ TEST_P(LUTTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1269,7 +1269,7 @@ TEST_P(ConvertToTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1378,7 +1378,7 @@ TEST_P(NormalizeTest, Test) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1654,7 +1654,7 @@ TEST_P(ReInitOutTest, TestWithAdd) // Comparison ////////////////////////////////////////////////////////////// EXPECT_EQ(0, cvtest::norm(out_mat_gapi, out_mat_ocv, NORM_INF)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); }; // run for uninitialized output @@ -1738,7 +1738,7 @@ TEST_P(SizeTest, ParseTest) cv::GComputation c(cv::GIn(in), cv::GOut(out)); c.apply(cv::gin(in_mat1), cv::gout(out_sz), getCompileArgs()); - EXPECT_EQ(out_sz, sz); + EXPECT_EQ(sz, out_sz); } TEST_P(SizeRTest, ParseTest) @@ -1751,7 +1751,7 @@ TEST_P(SizeRTest, ParseTest) cv::GComputation c(cv::GIn(op_rect), cv::GOut(out)); c.apply(cv::gin(rect), cv::gout(out_sz), getCompileArgs()); - EXPECT_EQ(out_sz, sz); + EXPECT_EQ(sz, out_sz); } namespace { @@ -1784,7 +1784,7 @@ TEST_P(SizeMFTest, ParseTest) cv::GComputation c(cv::GIn(in), cv::GOut(out)); c.apply(cv::gin(frame), cv::gout(out_sz), getCompileArgs()); - EXPECT_EQ(out_sz, sz); + EXPECT_EQ(sz, out_sz); } } // opencv_test diff --git a/modules/gapi/test/common/gapi_imgproc_tests_inl.hpp b/modules/gapi/test/common/gapi_imgproc_tests_inl.hpp index 755d09a6e4..6500c7853d 100644 --- a/modules/gapi/test/common/gapi_imgproc_tests_inl.hpp +++ b/modules/gapi/test/common/gapi_imgproc_tests_inl.hpp @@ -92,7 +92,7 @@ TEST_P(Filter2DTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -116,7 +116,7 @@ TEST_P(BoxFilterTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -142,7 +142,7 @@ TEST_P(SepFilterTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -163,7 +163,7 @@ TEST_P(BlurTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -185,7 +185,7 @@ TEST_P(GaussianBlurTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -204,7 +204,7 @@ TEST_P(MedianBlurTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -225,7 +225,7 @@ TEST_P(ErodeTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -246,7 +246,7 @@ TEST_P(Erode3x3Test, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -267,7 +267,7 @@ TEST_P(DilateTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -288,7 +288,7 @@ TEST_P(Dilate3x3Test, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -311,7 +311,7 @@ TEST_P(MorphologyExTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -330,7 +330,7 @@ TEST_P(SobelTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -362,8 +362,8 @@ TEST_P(SobelXYTest, AccuracyTest) { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); EXPECT_TRUE(cmpF(out_mat_gapi2, out_mat_ocv2)); - EXPECT_EQ(out_mat_gapi.size(), sz); - EXPECT_EQ(out_mat_gapi2.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); + EXPECT_EQ(sz, out_mat_gapi2.size()); } } @@ -383,7 +383,7 @@ TEST_P(LaplacianTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -402,7 +402,7 @@ TEST_P(BilateralFilterTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -421,7 +421,7 @@ TEST_P(EqHistTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -440,7 +440,7 @@ TEST_P(CannyTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -611,7 +611,7 @@ TEST_P(BGR2RGBTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -630,7 +630,7 @@ TEST_P(RGB2GrayTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -649,7 +649,7 @@ TEST_P(BGR2GrayTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -668,7 +668,7 @@ TEST_P(RGB2YUVTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -687,7 +687,7 @@ TEST_P(YUV2RGBTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -706,7 +706,7 @@ TEST_P(BGR2I420Test, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), Size(sz.width, sz.height * 3 / 2)); + EXPECT_EQ(Size(sz.width, sz.height * 3 / 2), out_mat_gapi.size()); } } @@ -725,7 +725,7 @@ TEST_P(RGB2I420Test, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), Size(sz.width, sz.height * 3 / 2)); + EXPECT_EQ(Size(sz.width, sz.height * 3 / 2), out_mat_gapi.size()); } } @@ -744,7 +744,7 @@ TEST_P(I4202BGRTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), Size(sz.width, sz.height * 2 / 3)); + EXPECT_EQ(Size(sz.width, sz.height * 2 / 3), out_mat_gapi.size()); } } @@ -763,7 +763,7 @@ TEST_P(I4202RGBTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), Size(sz.width, sz.height * 2 / 3)); + EXPECT_EQ(Size(sz.width, sz.height * 2 / 3), out_mat_gapi.size()); } } @@ -787,7 +787,7 @@ TEST_P(NV12toRGBTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -811,7 +811,7 @@ TEST_P(NV12toBGRTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -839,7 +839,7 @@ TEST_P(NV12toGrayTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -882,7 +882,7 @@ TEST_P(NV12toRGBpTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi_planar, out_mat_ocv_planar)); - EXPECT_EQ(out_mat_gapi_planar.size(), sz_p); + EXPECT_EQ(sz_p, out_mat_gapi_planar.size()); } } @@ -912,7 +912,7 @@ TEST_P(NV12toBGRpTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi_planar, out_mat_ocv_planar)); - EXPECT_EQ(out_mat_gapi_planar.size(), sz_p); + EXPECT_EQ(sz_p, out_mat_gapi_planar.size()); } } @@ -931,7 +931,7 @@ TEST_P(RGB2LabTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -950,7 +950,7 @@ TEST_P(BGR2LUVTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -969,7 +969,7 @@ TEST_P(LUV2BGRTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -988,7 +988,7 @@ TEST_P(BGR2YUVTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1007,7 +1007,7 @@ TEST_P(YUV2BGRTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1026,7 +1026,7 @@ TEST_P(RGB2HSVTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1045,7 +1045,7 @@ TEST_P(BayerGR2RGBTest, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } @@ -1064,7 +1064,7 @@ TEST_P(RGB2YUV422Test, AccuracyTest) // Comparison ////////////////////////////////////////////////////////////// { EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); - EXPECT_EQ(out_mat_gapi.size(), sz); + EXPECT_EQ(sz, out_mat_gapi.size()); } } } // opencv_test diff --git a/modules/gapi/test/common/gapi_operators_tests_inl.hpp b/modules/gapi/test/common/gapi_operators_tests_inl.hpp index ad579290d5..9f739428e0 100644 --- a/modules/gapi/test/common/gapi_operators_tests_inl.hpp +++ b/modules/gapi/test/common/gapi_operators_tests_inl.hpp @@ -36,7 +36,7 @@ TEST_P(MathOperatorMatScalarTest, OperatorAccuracyTest ) // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); } } @@ -63,7 +63,7 @@ TEST_P(MathOperatorMatMatTest, OperatorAccuracyTest ) // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv)); } } @@ -83,7 +83,7 @@ TEST_P(NotOperatorTest, OperatorAccuracyTest) } // Comparison ////////////////////////////////////////////////////////////// { - ASSERT_EQ(out_mat_gapi.size(), sz); + ASSERT_EQ(sz, out_mat_gapi.size()); EXPECT_EQ(0, cvtest::norm(out_mat_ocv, out_mat_gapi, NORM_INF)); } } diff --git a/modules/gapi/test/gapi_opaque_tests.cpp b/modules/gapi/test/gapi_opaque_tests.cpp index de3572c4bd..3af0a68909 100644 --- a/modules/gapi/test/gapi_opaque_tests.cpp +++ b/modules/gapi/test/gapi_opaque_tests.cpp @@ -161,7 +161,7 @@ TEST(GOpaque, TestOpaqueBetween) c.apply(cv::gin(mat_in), cv::gout(mat_out), cv::compile_args(cv::gapi::kernels())); int painted = mat_out.at(42, 42); - EXPECT_EQ(painted, 77); + EXPECT_EQ(77, painted); } TEST(GOpaque, TestOpaqueBetweenIslands) @@ -181,7 +181,7 @@ TEST(GOpaque, TestOpaqueBetweenIslands) c.apply(cv::gin(mat_in), cv::gout(mat_out), cv::compile_args(cv::gapi::kernels())); int painted = mat_out.at(42, 42); - EXPECT_EQ(painted, 77); + EXPECT_EQ(77, painted); } TEST(GOpaque, TestOpaqueCustomOut2) @@ -200,11 +200,11 @@ TEST(GOpaque, TestOpaqueCustomOut2) cv::GComputation c(cv::GIn(in1, in2), cv::GOut(std::get<0>(out), std::get<1>(out))); c.apply(cv::gin(input1, input2), cv::gout(out1, out2), cv::compile_args(cv::gapi::kernels())); - EXPECT_EQ(out1.num, input1.size().width * input1.size().height); - EXPECT_EQ(out1.s, str); + EXPECT_EQ(input1.size().width * input1.size().height, out1.num); + EXPECT_EQ(str, out1.s); - EXPECT_EQ(out2.num, input2.size().width * input2.size().height); - EXPECT_EQ(out2.s, str2); + EXPECT_EQ(input2.size().width * input2.size().height, out2.num); + EXPECT_EQ(str2, out2.s); } TEST(GOpaque, TestOpaqueOCLBackendIn) @@ -220,7 +220,7 @@ TEST(GOpaque, TestOpaqueOCLBackendIn) cv::compile_args(cv::gapi::kernels())); int painted = mat_out.at(42, 42); - EXPECT_EQ(painted, 77); + EXPECT_EQ(77, painted); } TEST(GOpaque, TestOpaqueOCLBackendBetween) @@ -240,7 +240,7 @@ TEST(GOpaque, TestOpaqueOCLBackendBetween) cv::compile_args(cv::gapi::kernels())); int painted = mat_out.at(42, 42); - EXPECT_EQ(painted, 77); + EXPECT_EQ(77, painted); } TEST(GOpaque, TestOpaqueOCLBackendOut) diff --git a/modules/gapi/test/infer/gapi_infer_onnx_test.cpp b/modules/gapi/test/infer/gapi_infer_onnx_test.cpp index b1bf9c9356..1f21f95ce8 100644 --- a/modules/gapi/test/infer/gapi_infer_onnx_test.cpp +++ b/modules/gapi/test/infer/gapi_infer_onnx_test.cpp @@ -231,7 +231,7 @@ void remapToIESSDOut(const std::vector &detections, } // SSD-MobilenetV1 structure check - ASSERT_EQ(detections[0].total(), 1u); + ASSERT_EQ(1u, detections[0].total()); ASSERT_EQ(detections[2].total(), detections[0].total() * 100); ASSERT_EQ(detections[2].total(), detections[3].total()); ASSERT_EQ((detections[2].total() * 4), detections[1].total()); diff --git a/modules/gapi/test/internal/gapi_int_gmetaarg_test.cpp b/modules/gapi/test/internal/gapi_int_gmetaarg_test.cpp index 81f1ad4e2d..78048cfa3f 100644 --- a/modules/gapi/test/internal/gapi_int_gmetaarg_test.cpp +++ b/modules/gapi/test/internal/gapi_int_gmetaarg_test.cpp @@ -102,7 +102,7 @@ TEST(GMetaArg, Can_Get_Metas_From_Input_Run_Args) GMatDesc m_desc; GMetaArgs meta_args = descr_of(cv::gin(m, s, v)); - EXPECT_EQ(meta_args.size(), 3u); + EXPECT_EQ(3u, meta_args.size()); EXPECT_NO_THROW(m_desc = util::get(meta_args[0])); EXPECT_NO_THROW(util::get(meta_args[1])); EXPECT_NO_THROW(util::get(meta_args[2])); diff --git a/modules/gapi/test/own/conc_queue_tests.cpp b/modules/gapi/test/own/conc_queue_tests.cpp index 6e268f318c..6234a42719 100644 --- a/modules/gapi/test/own/conc_queue_tests.cpp +++ b/modules/gapi/test/own/conc_queue_tests.cpp @@ -27,7 +27,7 @@ TEST(ConcQueue, PushPop) { int x; q.pop(x); - EXPECT_EQ(x, i); + EXPECT_EQ(i, x); } } diff --git a/modules/gapi/test/own/last_written_value_tests.cpp b/modules/gapi/test/own/last_written_value_tests.cpp index 4bfb27f15f..be9f13e47b 100644 --- a/modules/gapi/test/own/last_written_value_tests.cpp +++ b/modules/gapi/test/own/last_written_value_tests.cpp @@ -21,7 +21,7 @@ TEST(LastValue, PushPop) { int x = 1; v.pop(x); - EXPECT_EQ(x, i); + EXPECT_EQ(i, x); } } diff --git a/modules/gapi/test/own/mat_tests.cpp b/modules/gapi/test/own/mat_tests.cpp index 0ddc201f9f..22da4ef718 100644 --- a/modules/gapi/test/own/mat_tests.cpp +++ b/modules/gapi/test/own/mat_tests.cpp @@ -24,12 +24,12 @@ inline std::size_t multiply_dims(Dims const& dims){ TEST(OwnMat, DefaultConstruction) { Mat m; - ASSERT_EQ(m.data, nullptr); - ASSERT_EQ(m.cols, 0); - ASSERT_EQ(m.rows, 0); - ASSERT_EQ(m.cols, 0); - ASSERT_EQ(m.type(), 0); - ASSERT_EQ(m.depth(), 0); + ASSERT_EQ(nullptr, m.data); + ASSERT_EQ(0, m.cols); + ASSERT_EQ(0, m.rows); + ASSERT_EQ(0, m.cols); + ASSERT_EQ(0, m.type()); + ASSERT_EQ(0, m.depth()); ASSERT_TRUE(m.dims.empty()); ASSERT_TRUE(m.empty()); } @@ -40,15 +40,15 @@ TEST(OwnMat, Create) Mat m; m.create(size, CV_8UC1); - ASSERT_NE(m.data, nullptr); - ASSERT_EQ((cv::gapi::own::Size{m.cols, m.rows}), size); + ASSERT_NE(nullptr, m.data); + ASSERT_EQ(size, (cv::gapi::own::Size{m.cols, m.rows})); - ASSERT_EQ(m.total(), static_cast(size.height) * size.width); - ASSERT_EQ(m.type(), CV_8UC1); - ASSERT_EQ(m.depth(), CV_8U); - ASSERT_EQ(m.channels(), 1); - ASSERT_EQ(m.elemSize(), sizeof(uint8_t)); - ASSERT_EQ(m.step, sizeof(uint8_t) * m.cols); + ASSERT_EQ(static_cast(size.height) * size.width, m.total()); + ASSERT_EQ(CV_8UC1, m.type()); + ASSERT_EQ(CV_8U, m.depth()); + ASSERT_EQ(1, m.channels()); + ASSERT_EQ(sizeof(uint8_t), m.elemSize()); + ASSERT_EQ(sizeof(uint8_t) * m.cols, m.step); ASSERT_TRUE(m.dims.empty()); ASSERT_FALSE(m.empty()); } @@ -59,16 +59,16 @@ TEST(OwnMat, CreateND) Mat m; m.create(dims, CV_32F); - ASSERT_NE(nullptr , m.data ); + ASSERT_NE(nullptr , m.data); ASSERT_EQ((cv::gapi::own::Size{0,0}), (cv::gapi::own::Size{m.cols, m.rows})); ASSERT_EQ(multiply_dims(dims), m.total()); - ASSERT_EQ(CV_32F , m.type() ); - ASSERT_EQ(CV_32F , m.depth() ); - ASSERT_EQ(-1 , m.channels()); - ASSERT_EQ(sizeof(float) , m.elemSize()); - ASSERT_EQ(0u , m.step ); - ASSERT_EQ(dims , m.dims ); + ASSERT_EQ(CV_32F, m.type()); + ASSERT_EQ(CV_32F, m.depth()); + ASSERT_EQ(-1, m.channels()); + ASSERT_EQ(sizeof(float), m.elemSize()); + ASSERT_EQ(0u, m.step); + ASSERT_EQ(dims, m.dims); ASSERT_FALSE(m.empty()); } @@ -78,15 +78,15 @@ TEST(OwnMat, CreateOverload) Mat m; m.create(size.height,size.width, CV_8UC1); - ASSERT_NE(m.data, nullptr); - ASSERT_EQ((cv::Size{m.cols, m.rows}), size); + ASSERT_NE(nullptr, m.data); + ASSERT_EQ(size, (cv::Size{m.cols, m.rows})); - ASSERT_EQ(m.total(), static_cast(size.height) * size.width); - ASSERT_EQ(m.type(), CV_8UC1); - ASSERT_EQ(m.depth(), CV_8U); - ASSERT_EQ(m.channels(), 1); - ASSERT_EQ(m.elemSize(), sizeof(uint8_t)); - ASSERT_EQ(m.step, sizeof(uint8_t) * m.cols); + ASSERT_EQ(static_cast(size.height) * size.width, m.total()); + ASSERT_EQ(CV_8UC1, m.type()); + ASSERT_EQ(CV_8U, m.depth()); + ASSERT_EQ(1, m.channels()); + ASSERT_EQ(sizeof(uint8_t), m.elemSize()); + ASSERT_EQ(sizeof(uint8_t) * m.cols, m.step); ASSERT_TRUE(m.dims.empty()); ASSERT_FALSE(m.empty()); } @@ -97,14 +97,14 @@ TEST(OwnMat, Create3chan) Mat m; m.create(size, CV_8UC3); - ASSERT_NE(m.data, nullptr); - ASSERT_EQ((cv::Size{m.cols, m.rows}), size); + ASSERT_NE(nullptr, m.data); + ASSERT_EQ(size, (cv::Size{m.cols, m.rows})); - ASSERT_EQ(m.type(), CV_8UC3); - ASSERT_EQ(m.depth(), CV_8U); - ASSERT_EQ(m.channels(), 3); - ASSERT_EQ(m.elemSize(), 3 * sizeof(uint8_t)); - ASSERT_EQ(m.step, 3* sizeof(uint8_t) * m.cols); + ASSERT_EQ(CV_8UC3, m.type()); + ASSERT_EQ(CV_8U, m.depth()); + ASSERT_EQ(3, m.channels()); + ASSERT_EQ(3 * sizeof(uint8_t), m.elemSize()); + ASSERT_EQ(3 * sizeof(uint8_t) * m.cols, m.step); ASSERT_TRUE(m.dims.empty()); ASSERT_FALSE(m.empty()); } @@ -134,7 +134,7 @@ namespace { }; void ensure_mats_are_same(Mat const& copy, Mat const& m){ - EXPECT_NE(copy.data, nullptr); + EXPECT_NE(nullptr, copy.data); EXPECT_EQ(state_of(copy), state_of(m)); } } @@ -157,8 +157,8 @@ struct OwnMatMoveSemantics : NonEmptyMat, ::testing::Test { void ensure_state_moved_to(Mat const& moved_to) { - EXPECT_EQ(state_of(moved_to), initial_state); - EXPECT_EQ(state_of(moved_from), state_of(Mat{})); + EXPECT_EQ(state_of(moved_to), initial_state); + EXPECT_EQ(state_of(moved_from), state_of(Mat{})); } }; diff --git a/modules/gapi/test/own/scalar_tests.cpp b/modules/gapi/test/own/scalar_tests.cpp index 09fec67ab9..05f97be8da 100644 --- a/modules/gapi/test/own/scalar_tests.cpp +++ b/modules/gapi/test/own/scalar_tests.cpp @@ -17,7 +17,7 @@ TEST(Scalar, CreateEmpty) for (int i = 0; i < 4; ++i) { - EXPECT_EQ(s[i], 0.0); + EXPECT_EQ(0.0, s[i]); } } @@ -25,20 +25,20 @@ TEST(Scalar, CreateFromVal) { cv::gapi::own::Scalar s(5.0); - EXPECT_EQ(s[0], 5.0); - EXPECT_EQ(s[1], 0.0); - EXPECT_EQ(s[2], 0.0); - EXPECT_EQ(s[3], 0.0); + EXPECT_EQ(5.0, s[0]); + EXPECT_EQ(0.0, s[1]); + EXPECT_EQ(0.0, s[2]); + EXPECT_EQ(0.0, s[3]); } TEST(Scalar, CreateFromVals) { cv::gapi::own::Scalar s(5.3, 3.3, 4.1, -2.0); - EXPECT_EQ(s[0], 5.3); - EXPECT_EQ(s[1], 3.3); - EXPECT_EQ(s[2], 4.1); - EXPECT_EQ(s[3], -2.0); + EXPECT_EQ(5.3, s[0]); + EXPECT_EQ(3.3, s[1]); + EXPECT_EQ(4.1, s[2]); + EXPECT_EQ(-2.0, s[3]); } } // namespace opencv_test diff --git a/modules/gapi/test/streaming/gapi_streaming_tests.cpp b/modules/gapi/test/streaming/gapi_streaming_tests.cpp index 4f8b2563ac..57e061861c 100644 --- a/modules/gapi/test/streaming/gapi_streaming_tests.cpp +++ b/modules/gapi/test/streaming/gapi_streaming_tests.cpp @@ -1130,7 +1130,7 @@ TEST_F(GAPI_Streaming_TemplateTypes, UnusedVectorIsOK) } GAPI_Assert(out_mat || out_int); if (out_int) { - EXPECT_EQ( 3, out_int.value()); + EXPECT_EQ(3, out_int.value()); } } } @@ -1748,7 +1748,7 @@ TEST(GAPI_Streaming_Desync, MultipleDesyncOutputs_1) { if (out_vec || out_int) { EXPECT_EQ(320, out_vec.value()[0]); EXPECT_EQ(240, out_vec.value()[1]); - EXPECT_EQ( 3, out_int.value()); + EXPECT_EQ(3, out_int.value()); } } } diff --git a/modules/gapi/test/streaming/gapi_streaming_vpl_core_test.cpp b/modules/gapi/test/streaming/gapi_streaming_vpl_core_test.cpp index 0b8822b366..3ffdaf0fc9 100644 --- a/modules/gapi/test/streaming/gapi_streaming_vpl_core_test.cpp +++ b/modules/gapi/test/streaming/gapi_streaming_vpl_core_test.cpp @@ -124,11 +124,11 @@ TEST(OneVPL_Source_Surface, InitSurface) // check self consistency EXPECT_EQ(reinterpret_cast(surf->get_handle()), reinterpret_cast(mfx_core_handle)); - EXPECT_EQ(surf->get_locks_count(), 0); - EXPECT_EQ(surf->obtain_lock(), 0); - EXPECT_EQ(surf->get_locks_count(), 1); - EXPECT_EQ(surf->release_lock(), 1); - EXPECT_EQ(surf->get_locks_count(), 0); + EXPECT_EQ(0, surf->get_locks_count()); + EXPECT_EQ(0, surf->obtain_lock()); + EXPECT_EQ(1, surf->get_locks_count()); + EXPECT_EQ(1, surf->release_lock()); + EXPECT_EQ(0, surf->get_locks_count()); } TEST(OneVPL_Source_Surface, ConcurrentLock) @@ -143,7 +143,7 @@ TEST(OneVPL_Source_Surface, ConcurrentLock) auto surf = Surface::create_surface(std::move(handle), associated_memory); // check self consistency - EXPECT_EQ(surf->get_locks_count(), 0); + EXPECT_EQ(0, surf->get_locks_count()); // MFX internal limitation: do not exceede U16 range // so I16 is using here @@ -168,7 +168,7 @@ TEST(OneVPL_Source_Surface, ConcurrentLock) } worker_thread.join(); - EXPECT_EQ(surf->get_locks_count(), lock_counter * 2); + EXPECT_EQ(lock_counter * 2, surf->get_locks_count()); } TEST(OneVPL_Source_Surface, MemoryLifeTime) @@ -180,7 +180,7 @@ TEST(OneVPL_Source_Surface, MemoryLifeTime) std::shared_ptr associated_memory (preallocated_memory_ptr.get(), [&preallocated_memory_ptr] (void* ptr) { EXPECT_TRUE(preallocated_memory_ptr); - EXPECT_EQ(preallocated_memory_ptr.get(), ptr); + EXPECT_EQ(ptr, preallocated_memory_ptr.get()); preallocated_memory_ptr.reset(); }); @@ -201,7 +201,7 @@ TEST(OneVPL_Source_Surface, MemoryLifeTime) } // workspace memory must be alive - EXPECT_EQ(surfaces.size(), 0); + EXPECT_EQ(0, surfaces.size()); EXPECT_TRUE(associated_memory != nullptr); EXPECT_TRUE(preallocated_memory_ptr.get() != nullptr); @@ -223,7 +223,7 @@ TEST(OneVPL_Source_Surface, MemoryLifeTime) associated_memory.reset(); // workspace memory must be still alive - EXPECT_EQ(surfaces.size(), 0); + EXPECT_EQ(0, surfaces.size()); EXPECT_TRUE(associated_memory == nullptr); EXPECT_TRUE(preallocated_memory_ptr.get() != nullptr); @@ -246,13 +246,13 @@ TEST(OneVPL_Source_CPU_FrameAdapter, InitFrameAdapter) auto surf = Surface::create_surface(std::move(handle), associated_memory); // check consistency - EXPECT_EQ(surf->get_locks_count(), 0); + EXPECT_EQ(0, surf->get_locks_count()); { VPLMediaFrameCPUAdapter adapter(surf); - EXPECT_EQ(surf->get_locks_count(), 1); + EXPECT_EQ(1, surf->get_locks_count()); } - EXPECT_EQ(surf->get_locks_count(), 0); + EXPECT_EQ(0, surf->get_locks_count()); } TEST(OneVPL_Source_CPU_Accelerator, InitDestroy) @@ -276,8 +276,8 @@ TEST(OneVPL_Source_CPU_Accelerator, InitDestroy) surface_size_bytes, create_test_surface); // check consistency - EXPECT_EQ(acceleration_policy->get_surface_count(key), surface_count); - EXPECT_EQ(acceleration_policy->get_free_surface_count(key), surface_count); + EXPECT_EQ(surface_count, acceleration_policy->get_surface_count(key)); + EXPECT_EQ(surface_count, acceleration_policy->get_free_surface_count(key)); pool_export_keys.push_back(key); } @@ -301,8 +301,8 @@ TEST(OneVPL_Source_CPU_Accelerator, PoolProduceConsume) surface_size_bytes, create_test_surface); // check consistency - EXPECT_EQ(acceleration_policy->get_surface_count(key), surface_count); - EXPECT_EQ(acceleration_policy->get_free_surface_count(key), surface_count); + EXPECT_EQ(surface_count, acceleration_policy->get_surface_count(key)); + EXPECT_EQ(surface_count, acceleration_policy->get_free_surface_count(key)); // consume available surfaces std::vector> surfaces; @@ -310,13 +310,13 @@ TEST(OneVPL_Source_CPU_Accelerator, PoolProduceConsume) for (size_t i = 0; i < surface_count; i++) { std::shared_ptr surf = acceleration_policy->get_free_surface(key).lock(); EXPECT_TRUE(surf.get() != nullptr); - EXPECT_EQ(surf->obtain_lock(), 0); + EXPECT_EQ(0, surf->obtain_lock()); surfaces.push_back(std::move(surf)); } // check consistency (no free surfaces) EXPECT_EQ(acceleration_policy->get_surface_count(key), surface_count); - EXPECT_EQ(acceleration_policy->get_free_surface_count(key), 0); + EXPECT_EQ(0, acceleration_policy->get_free_surface_count(key)); // fail consume non-free surfaces for (size_t i = 0; i < surface_count; i++) { @@ -325,19 +325,19 @@ TEST(OneVPL_Source_CPU_Accelerator, PoolProduceConsume) // release surfaces for (auto& surf : surfaces) { - EXPECT_EQ(surf->release_lock(), 1); + EXPECT_EQ(1, surf->release_lock()); } surfaces.clear(); // check consistency - EXPECT_EQ(acceleration_policy->get_surface_count(key), surface_count); - EXPECT_EQ(acceleration_policy->get_free_surface_count(key), surface_count); + EXPECT_EQ(surface_count, acceleration_policy->get_surface_count(key)); + EXPECT_EQ(surface_count, acceleration_policy->get_free_surface_count(key)); //check availability after release for (size_t i = 0; i < surface_count; i++) { std::shared_ptr surf = acceleration_policy->get_free_surface(key).lock(); EXPECT_TRUE(surf.get() != nullptr); - EXPECT_EQ(surf->obtain_lock(), 0); + EXPECT_EQ(0, surf->obtain_lock()); } } @@ -358,8 +358,8 @@ TEST(OneVPL_Source_CPU_Accelerator, PoolProduceConcurrentConsume) create_test_surface); // check consistency - EXPECT_EQ(acceleration_policy->get_surface_count(key), surface_count); - EXPECT_EQ(acceleration_policy->get_free_surface_count(key), surface_count); + EXPECT_EQ(surface_count, acceleration_policy->get_surface_count(key)); + EXPECT_EQ(surface_count, acceleration_policy->get_free_surface_count(key)); // consume available surfaces std::vector> surfaces; @@ -367,7 +367,7 @@ TEST(OneVPL_Source_CPU_Accelerator, PoolProduceConcurrentConsume) for (size_t i = 0; i < surface_count; i++) { std::shared_ptr surf = acceleration_policy->get_free_surface(key).lock(); EXPECT_TRUE(surf.get() != nullptr); - EXPECT_EQ(surf->obtain_lock(), 0); + EXPECT_EQ(0, surf->obtain_lock()); surfaces.push_back(std::move(surf)); } @@ -381,7 +381,7 @@ TEST(OneVPL_Source_CPU_Accelerator, PoolProduceConcurrentConsume) // concurrent release surfaces size_t surfaces_count = surfaces.size(); for (auto& surf : surfaces) { - EXPECT_EQ(surf->release_lock(), 1); + EXPECT_EQ(1, surf->release_lock()); std::this_thread::sleep_for(std::chrono::seconds(1)); } surfaces.clear(); @@ -415,28 +415,28 @@ TEST(OneVPL_Source_ProcessingEngine, Init) mfxSession mfx_session{}; engine.initialize_session(mfx_session, DecoderParams{}, std::shared_ptr{}); - EXPECT_EQ(engine.get_ready_frames_count(), 0); + EXPECT_EQ(0, engine.get_ready_frames_count()); ProcessingEngineBase::ExecutionStatus ret = engine.process(mfx_session); EXPECT_EQ(ret, ProcessingEngineBase::ExecutionStatus::Continue); - EXPECT_EQ(engine.pipeline_stage_num, 0); + EXPECT_EQ(0, engine.pipeline_stage_num); ret = engine.process(mfx_session); EXPECT_EQ(ret, ProcessingEngineBase::ExecutionStatus::Continue); - EXPECT_EQ(engine.pipeline_stage_num, 1); + EXPECT_EQ(1, engine.pipeline_stage_num); ret = engine.process(mfx_session); EXPECT_EQ(ret, ProcessingEngineBase::ExecutionStatus::Continue); - EXPECT_EQ(engine.pipeline_stage_num, 2); + EXPECT_EQ(2, engine.pipeline_stage_num); ret = engine.process(mfx_session); EXPECT_EQ(ret, ProcessingEngineBase::ExecutionStatus::Processed); - EXPECT_EQ(engine.pipeline_stage_num, 3); - EXPECT_EQ(engine.get_ready_frames_count(), 1); + EXPECT_EQ(3, engine.pipeline_stage_num); + EXPECT_EQ(1, engine.get_ready_frames_count()); ret = engine.process(mfx_session); EXPECT_EQ(ret, ProcessingEngineBase::ExecutionStatus::SessionNotFound); - EXPECT_EQ(engine.pipeline_stage_num, 3); - EXPECT_EQ(engine.get_ready_frames_count(), 1); + EXPECT_EQ(3, engine.pipeline_stage_num); + EXPECT_EQ(1, engine.get_ready_frames_count()); cv::gapi::wip::Data frame; engine.get_frame(frame); diff --git a/modules/gapi/test/util/any_tests.cpp b/modules/gapi/test/util/any_tests.cpp index 238c6dbd7b..890aabc72e 100644 --- a/modules/gapi/test/util/any_tests.cpp +++ b/modules/gapi/test/util/any_tests.cpp @@ -17,10 +17,10 @@ TEST(Any, basic) any a(8); auto casted_pointer = any_cast(&a); ASSERT_NE(nullptr, casted_pointer); - ASSERT_EQ(*casted_pointer, 8); + ASSERT_EQ(8, *casted_pointer); *casted_pointer = 7; - ASSERT_EQ(any_cast(a), 7); + ASSERT_EQ(7, any_cast(a)); } TEST(Any, any_cast_ref_throws_on_empty) @@ -36,13 +36,13 @@ TEST(Any, copy) using namespace util; any a(8); - ASSERT_EQ(any_cast(a), 8); + ASSERT_EQ(8, any_cast(a)); any b (a); ASSERT_NE(nullptr, any_cast(&b)); - ASSERT_EQ(8 , any_cast(b)); - ASSERT_EQ(8 , any_cast(a)); + ASSERT_EQ(8, any_cast(b)); + ASSERT_EQ(8, any_cast(a)); } TEST(Any, copy_empty) @@ -63,12 +63,12 @@ TEST(Any, move) using namespace util; any a(8); - ASSERT_EQ(any_cast(a), 8); + ASSERT_EQ(8, any_cast(a)); any b (std::move(a)); ASSERT_NE(nullptr, any_cast(&b)); - ASSERT_EQ(8 , any_cast(b)); + ASSERT_EQ(8, any_cast(b)); ASSERT_EQ(nullptr, any_cast(&a)); } @@ -93,12 +93,12 @@ TEST(Any, move_assign) any a(8); any b; - ASSERT_EQ(any_cast(a), 8); + ASSERT_EQ(8, any_cast(a)); b = (std::move(a)); ASSERT_NE(nullptr, any_cast(&b)); - ASSERT_EQ(8 , any_cast(b)); + ASSERT_EQ(8, any_cast(b)); ASSERT_EQ(nullptr, any_cast(&a)); } @@ -108,14 +108,14 @@ TEST(Any, copy_assign) any a(8); any b; - ASSERT_EQ(any_cast(a), 8); + ASSERT_EQ(8, any_cast(a)); ASSERT_EQ(nullptr, any_cast(&b)); b = a; ASSERT_NE(nullptr, any_cast(&b)); - ASSERT_EQ(8 , any_cast(b)); - ASSERT_EQ(8 , any_cast(a)); + ASSERT_EQ(8, any_cast(b)); + ASSERT_EQ(8, any_cast(a)); } TEST(Any, get_ref_to_val_from_any) @@ -125,7 +125,7 @@ TEST(Any, get_ref_to_val_from_any) any a(x); int& casted_ref = any_cast(a); - ASSERT_EQ(casted_ref, 8); + ASSERT_EQ(8, casted_ref); } TEST(Any, update_val_via_ref) @@ -134,9 +134,9 @@ TEST(Any, update_val_via_ref) int x = 8; any a(x); int& casted_ref = any_cast(a); - ASSERT_EQ(casted_ref, 8); + ASSERT_EQ(8, casted_ref); casted_ref = 7; - ASSERT_EQ(any_cast(a), 7); + ASSERT_EQ(7, any_cast(a)); } } // namespace opencv_test diff --git a/modules/gapi/test/util/variant_tests.cpp b/modules/gapi/test/util/variant_tests.cpp index 7725f9a702..aa096e711c 100644 --- a/modules/gapi/test/util/variant_tests.cpp +++ b/modules/gapi/test/util/variant_tests.cpp @@ -587,34 +587,34 @@ TEST(Variant, DynamicVisitor) test_validation::MyBoolParamIndexedVisitor visitor(ss); EXPECT_TRUE(cv::util::visit(visitor, var, int{42})); - EXPECT_EQ(ss.str(), std::string("0:42,")); + EXPECT_EQ(std::string("0:42,"), ss.str()); } std::stringstream ss; test_validation::MyBoolNoParamNonIndexedVisitor visitor(ss); cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("0:42,")); + EXPECT_EQ(std::string("0:42,"), ss.str()); var = double{1.0}; EXPECT_TRUE(cv::util::visit(visitor, var)); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,")); + EXPECT_EQ(std::string("0:42,1:1,"), ss.str()); var = char{'a'}; EXPECT_TRUE(cv::util::visit(visitor, var)); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,"), ss.str()); var = float{6.0}; EXPECT_TRUE(cv::util::visit(visitor, var)); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,3:6,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,3:6,"), ss.str()); var = test_validation::MyType{}; EXPECT_TRUE(cv::util::visit(visitor, var)); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,3:6,4:MyType,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,3:6,4:MyType,"), ss.str()); var = test_validation::MyClass{}; EXPECT_TRUE(cv::util::visit(visitor, var)); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,3:6,4:MyType,5:MyClass,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,3:6,4:MyType,5:MyClass,"), ss.str()); } TEST(Variant, StaticVisitor) @@ -625,27 +625,27 @@ TEST(Variant, StaticVisitor) test_validation::MyVoidNoParamNonIndexedVisitor visitor(ss); cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("42,")); + EXPECT_EQ(std::string("42,"), ss.str()); var = double{1.0}; cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("42,1,")); + EXPECT_EQ(std::string("42,1,"), ss.str()); var = char{'a'}; cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("42,1,a,")); + EXPECT_EQ(std::string("42,1,a,"), ss.str()); var = float{6.0}; cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("42,1,a,6,")); + EXPECT_EQ(std::string("42,1,a,6,"), ss.str()); var = test_validation::MyType{}; cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("42,1,a,6,MyType,")); + EXPECT_EQ(std::string("42,1,a,6,MyType,"), ss.str()); var = test_validation::MyClass{}; cv::util::visit(visitor, var); - EXPECT_EQ(ss.str(), std::string("42,1,a,6,MyType,MyClass,")); + EXPECT_EQ(std::string("42,1,a,6,MyType,MyClass,"), ss.str()); } TEST(Variant, StaticIndexedVisitor) @@ -655,27 +655,27 @@ TEST(Variant, StaticIndexedVisitor) std::stringstream ss; cv::util::visit(test_validation::MyVoidNoParamIndexedVisitor {ss}, var); - EXPECT_EQ(ss.str(), std::string("0:42,")); + EXPECT_EQ(std::string("0:42,"), ss.str()); var = double{1.0}; cv::util::visit(test_validation::MyVoidNoParamIndexedVisitor (ss), var); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,")); + EXPECT_EQ(std::string("0:42,1:1,"), ss.str()); var = char{'a'}; cv::util::visit(test_validation::MyVoidNoParamIndexedVisitor (ss), var); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,"), ss.str()); var = float{6.0}; cv::util::visit(test_validation::MyVoidNoParamIndexedVisitor (ss), var); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,3:6,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,3:6,"), ss.str()); var = test_validation::MyType{}; cv::util::visit(test_validation::MyVoidNoParamIndexedVisitor (ss), var); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,3:6,4:MyType,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,3:6,4:MyType,"), ss.str()); var = test_validation::MyClass{}; cv::util::visit(test_validation::MyVoidNoParamIndexedVisitor (ss), var); - EXPECT_EQ(ss.str(), std::string("0:42,1:1,2:a,3:6,4:MyType,5:MyClass,")); + EXPECT_EQ(std::string("0:42,1:1,2:a,3:6,4:MyType,5:MyClass,"), ss.str()); } @@ -686,7 +686,7 @@ TEST(Variant, LambdaVisitor) { cv::util::visit(cv::util::overload_lambdas( [](int value) { - EXPECT_EQ(value, 42); + EXPECT_EQ(42, value); }, [](double) { ADD_FAILURE() << "can't be called for `double`"; @@ -719,7 +719,7 @@ TEST(Variant, LambdaVisitor) ADD_FAILURE() << "can't be called for `double`"; }, [](char value) { - EXPECT_EQ(value, 'c'); + EXPECT_EQ('c', value); }, [](float) { ADD_FAILURE() << "can't be called for `float`";