From: Maria Dimashova Date: Tue, 4 Oct 2011 12:29:56 +0000 (+0000) Subject: updated test on lsvm X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~5961 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba62621534d6ce8d059ef8f46918ed15ee76799a;p=platform%2Fupstream%2Fopencv.git updated test on lsvm --- diff --git a/modules/objdetect/test/test_latentsvmdetector.cpp b/modules/objdetect/test/test_latentsvmdetector.cpp index 7213d57..da9fb3a 100644 --- a/modules/objdetect/test/test_latentsvmdetector.cpp +++ b/modules/objdetect/test/test_latentsvmdetector.cpp @@ -238,6 +238,7 @@ void LatentSVMDetectorTest::run( int /* start_from */) return; } + // 1. Test method detect // Run detectors vector detections1_cat, detections12_cat, detections12_cars; detector1.detect( image_cat, detections1_cat, 0.5, numThreads ); @@ -283,6 +284,20 @@ void LatentSVMDetectorTest::run( int /* start_from */) std::cerr << "File " << true_res_path << " cann't be opened to save test results" << std::endl; } + // 2. Simple tests of other methods + if( detector1.getClassCount() != 1 || detector1.getClassNames()[0] != "cat" ) + { + std::cerr << "Incorrect result of method getClassNames() or getClassCount()" << std::endl; + ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT); + } + + detector1.clear(); + if( !detector1.empty() ) + { + std::cerr << "There is a bug in method clear() or empty()" << std::endl; + ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT); + } + ts->set_failed_test_info( cvtest::TS::OK); }