From 134ae8e2128ed247272d6cdc4e3be0e7f00bf29e Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Wed, 19 Jan 2011 13:13:23 +0000 Subject: [PATCH] updates protected code testing for gpu HOGDescriptor --- tests/gpu/src/hog.cpp | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/tests/gpu/src/hog.cpp b/tests/gpu/src/hog.cpp index 474f3bc..fd797e9 100644 --- a/tests/gpu/src/hog.cpp +++ b/tests/gpu/src/hog.cpp @@ -51,9 +51,9 @@ using namespace std; ts->set_failed_test_info(err); \ return; } -struct CV_GpuHogDetectionTest: public CvTest, public cv::gpu::HOGDescriptor +struct CV_GpuHogDetectTestRunner: cv::gpu::HOGDescriptor { - CV_GpuHogDetectionTest(): CvTest("GPU-HOG-detect", "HOGDescriptorDetection") {} + CV_GpuHogDetectTestRunner(CvTS* ts_): ts(ts_) {} void run(int) { @@ -185,13 +185,25 @@ struct CV_GpuHogDetectionTest: public CvTest, public cv::gpu::HOGDescriptor std::ifstream f; #endif -} gpu_hog_detection_test; + CvTS* ts; +}; -struct CV_GpuHogGetDescriptorsTest: public CvTest, public cv::gpu::HOGDescriptor +struct CV_GpuHogDetectTest: CvTest { - CV_GpuHogGetDescriptorsTest(): - CvTest("GPU-HOG-getDescriptors", "HOGDescriptorGetDescriptors"), HOGDescriptor(cv::Size(64, 128)) {} + CV_GpuHogDetectTest(): CvTest("GPU-HogDetectTest", "HOGDescriptor::detect") {} + + void run(int i) + { + CV_GpuHogDetectTestRunner runner(ts); + runner.run(i); + } +} CV_GpuHogDetectTest_inst; + + +struct CV_GpuHogGetDescriptorsTestRunner: cv::gpu::HOGDescriptor +{ + CV_GpuHogGetDescriptorsTestRunner(CvTS* ts_): HOGDescriptor(cv::Size(64, 128)), ts(ts_) {} void run(int) { @@ -303,5 +315,18 @@ struct CV_GpuHogGetDescriptorsTest: public CvTest, public cv::gpu::HOGDescriptor int blocks_per_win_x; int blocks_per_win_y; int block_hist_size; -} gpu_hog_get_descriptors_test; + CvTS* ts; +}; + + +struct CV_GpuHogGetDescriptorsTest: CvTest +{ + CV_GpuHogGetDescriptorsTest(): CvTest("GPU-HogGetDescriptorsTest", "HOGDescriptor::getDescriptors") {} + + void run(int i) + { + CV_GpuHogGetDescriptorsTestRunner runner(ts); + runner.run(i); + } +} CV_GpuHogGetDescriptorsTest_inst; \ No newline at end of file -- 2.7.4