@@ -322,16 +322,20 @@ namespace cvtest
322
322
323
323
if (m1.size () != m2.size ())
324
324
{
325
- return AssertionFailure () << " Matrices \" " << expr1 << " \" and \" " << expr2 << " \" have different sizes : \" "
326
- << expr1 << " \" [" << PrintToString (m1.size ()) << " ] vs \" "
327
- << expr2 << " \" [" << PrintToString (m2.size ()) << " ]" ;
325
+ std::stringstream msg;
326
+ msg << " Matrices \" " << expr1 << " \" and \" " << expr2 << " \" have different sizes : \" "
327
+ << expr1 << " \" [" << PrintToString (m1.size ()) << " ] vs \" "
328
+ << expr2 << " \" [" << PrintToString (m2.size ()) << " ]" ;
329
+ return AssertionFailure () << msg.str ();
328
330
}
329
331
330
332
if (m1.type () != m2.type ())
331
333
{
332
- return AssertionFailure () << " Matrices \" " << expr1 << " \" and \" " << expr2 << " \" have different types : \" "
333
- << expr1 << " \" [" << PrintToString (MatType (m1.type ())) << " ] vs \" "
334
- << expr2 << " \" [" << PrintToString (MatType (m2.type ())) << " ]" ;
334
+ std::stringstream msg;
335
+ msg << " Matrices \" " << expr1 << " \" and \" " << expr2 << " \" have different types : \" "
336
+ << expr1 << " \" [" << PrintToString (MatType (m1.type ())) << " ] vs \" "
337
+ << expr2 << " \" [" << PrintToString (MatType (m2.type ())) << " ]" ;
338
+ return AssertionFailure () << msg.str ();
335
339
}
336
340
337
341
Mat diff;
@@ -343,12 +347,14 @@ namespace cvtest
343
347
344
348
if (maxVal > eps)
345
349
{
346
- return AssertionFailure () << " The max difference between matrices \" " << expr1 << " \" and \" " << expr2
347
- << " \" is " << maxVal << " at (" << maxLoc.y << " , " << maxLoc.x / m1.channels () << " )"
348
- << " , which exceeds \" " << eps_expr << " \" , where \" "
349
- << expr1 << " \" at (" << maxLoc.y << " , " << maxLoc.x / m1.channels () << " ) evaluates to " << printMatVal (m1, maxLoc) << " , \" "
350
- << expr2 << " \" at (" << maxLoc.y << " , " << maxLoc.x / m1.channels () << " ) evaluates to " << printMatVal (m2, maxLoc) << " , \" "
351
- << eps_expr << " \" evaluates to " << eps;
350
+ std::stringstream msg;
351
+ msg << " The max difference between matrices \" " << expr1 << " \" and \" " << expr2
352
+ << " \" is " << maxVal << " at (" << maxLoc.y << " , " << maxLoc.x / m1.channels () << " )"
353
+ << " , which exceeds \" " << eps_expr << " \" , where \" "
354
+ << expr1 << " \" at (" << maxLoc.y << " , " << maxLoc.x / m1.channels () << " ) evaluates to " << printMatVal (m1, maxLoc) << " , \" "
355
+ << expr2 << " \" at (" << maxLoc.y << " , " << maxLoc.x / m1.channels () << " ) evaluates to " << printMatVal (m2, maxLoc) << " , \" "
356
+ << eps_expr << " \" evaluates to " << eps;
357
+ return AssertionFailure () << msg.str ();
352
358
}
353
359
354
360
return AssertionSuccess ();
@@ -469,9 +475,11 @@ namespace cvtest
469
475
{
470
476
if (gold.size () != actual.size ())
471
477
{
472
- return testing::AssertionFailure () << " KeyPoints size mistmach\n "
473
- << " \" " << gold_expr << " \" : " << gold.size () << " \n "
474
- << " \" " << actual_expr << " \" : " << actual.size ();
478
+ std::stringstream msg;
479
+ msg << " KeyPoints size mistmach\n "
480
+ << " \" " << gold_expr << " \" : " << gold.size () << " \n "
481
+ << " \" " << actual_expr << " \" : " << actual.size ();
482
+ return AssertionFailure () << msg.str ();
475
483
}
476
484
477
485
std::sort (actual.begin (), actual.end (), KeyPointLess ());
@@ -484,14 +492,16 @@ namespace cvtest
484
492
485
493
if (!keyPointsEquals (p1, p2))
486
494
{
487
- return testing::AssertionFailure () << " KeyPoints differ at " << i << " \n "
488
- << " \" " << gold_expr << " \" vs \" " << actual_expr << " \" : \n "
489
- << " pt : " << testing::PrintToString (p1.pt ) << " vs " << testing::PrintToString (p2.pt ) << " \n "
490
- << " size : " << p1.size << " vs " << p2.size << " \n "
491
- << " angle : " << p1.angle << " vs " << p2.angle << " \n "
492
- << " response : " << p1.response << " vs " << p2.response << " \n "
493
- << " octave : " << p1.octave << " vs " << p2.octave << " \n "
494
- << " class_id : " << p1.class_id << " vs " << p2.class_id ;
495
+ std::stringstream msg;
496
+ msg << " KeyPoints differ at " << i << " \n "
497
+ << " \" " << gold_expr << " \" vs \" " << actual_expr << " \" : \n "
498
+ << " pt : " << testing::PrintToString (p1.pt ) << " vs " << testing::PrintToString (p2.pt ) << " \n "
499
+ << " size : " << p1.size << " vs " << p2.size << " \n "
500
+ << " angle : " << p1.angle << " vs " << p2.angle << " \n "
501
+ << " response : " << p1.response << " vs " << p2.response << " \n "
502
+ << " octave : " << p1.octave << " vs " << p2.octave << " \n "
503
+ << " class_id : " << p1.class_id << " vs " << p2.class_id ;
504
+ return AssertionFailure () << msg.str ();
495
505
}
496
506
}
497
507
0 commit comments