minor gpu tests fix
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Mon, 20 Aug 2012 06:15:36 +0000 (10:15 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Mon, 20 Aug 2012 06:15:36 +0000 (10:15 +0400)
26 files changed:
modules/gpu/perf/main.cpp
modules/gpu/test/main.cpp
modules/gpu/test/main_test_nvidia.h
modules/gpu/test/test_calib3d.cpp
modules/gpu/test/test_color.cpp
modules/gpu/test/test_copy_make_border.cpp
modules/gpu/test/test_core.cpp
modules/gpu/test/test_features2d.cpp
modules/gpu/test/test_filters.cpp
modules/gpu/test/test_global_motion.cpp
modules/gpu/test/test_gpumat.cpp
modules/gpu/test/test_imgproc.cpp
modules/gpu/test/test_labeling.cpp
modules/gpu/test/test_nvidia.cpp
modules/gpu/test/test_objdetect.cpp
modules/gpu/test/test_precomp.cpp
modules/gpu/test/test_precomp.hpp
modules/gpu/test/test_pyramids.cpp
modules/gpu/test/test_remap.cpp
modules/gpu/test/test_resize.cpp
modules/gpu/test/test_threshold.cpp
modules/gpu/test/test_video.cpp
modules/gpu/test/test_warp_affine.cpp
modules/gpu/test/test_warp_perspective.cpp
modules/gpu/test/utility.cpp
modules/gpu/test/utility.hpp

index 865362f..aadeee9 100644 (file)
@@ -71,9 +71,9 @@ void printCudaInfo()
 #endif\r
 }\r
 \r
-int main(int argc, char **argv)\r
+int main(int argc, char** argv)\r
 {\r
-    CommandLineParser cmd(argc, argv,\r
+    CommandLineParser cmd(argc, (const char**) argv,\r
         "{ print_info_only | print_info_only | false | Print information about system and exit }"\r
         "{ device | device | 0 | Device on which tests will be executed }"\r
         "{ cpu | cpu | false | Run tests on cpu }"\r
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
         cout << "Run tests on device " << device << " [" << info.name() << "] \n" << endl;\r
     }\r
 \r
-    testing::InitGoogleTest(&argc, argv);\r
+    InitGoogleTest(&argc, argv);\r
     perf::TestBase::Init(argc, argv);\r
     return RUN_ALL_TESTS();\r
 }\r
index 6df7db0..8f216c9 100644 (file)
@@ -39,7 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
 \r
 #ifdef HAVE_CUDA\r
 \r
@@ -49,93 +49,103 @@ using namespace cv::gpu;
 using namespace cvtest;\r
 using namespace testing;\r
 \r
-void printInfo()\r
+void printOsInfo()\r
 {\r
 #if defined _WIN32\r
 #   if defined _WIN64\r
-        puts("OS: Windows x64");\r
+        cout << "OS: Windows x64 \n" << endl;\r
 #   else\r
-        puts("OS: Windows x32");\r
+        cout << "OS: Windows x32 \n" << endl;\r
 #   endif\r
 #elif defined linux\r
 #   if defined _LP64\r
-        puts("OS: Linux x64");\r
+        cout << "OS: Linux x64 \n" << endl;\r
 #   else\r
-        puts("OS: Linux x32");\r
+        cout << "OS: Linux x32 \n" << endl;\r
 #   endif\r
 #elif defined __APPLE__\r
 #   if defined _LP64\r
-        puts("OS: Apple x64");\r
+        cout << "OS: Apple x64 \n" << endl;\r
 #   else\r
-        puts("OS: Apple x32");\r
+        cout << "OS: Apple x32 \n" << endl;\r
 #   endif\r
 #endif\r
+}\r
 \r
+void printCudaInfo()\r
+{\r
+#ifndef HAVE_CUDA\r
+    cout << "OpenCV was built without CUDA support \n" << endl;\r
+#else\r
     int driver;\r
     cudaDriverGetVersion(&driver);\r
 \r
-    printf("CUDA Driver  version: %d\n", driver);\r
-    printf("CUDA Runtime version: %d\n", CUDART_VERSION);\r
+    cout << "CUDA Driver  version: " << driver << '\n';\r
+    cout << "CUDA Runtime version: " << CUDART_VERSION << '\n';\r
+\r
+    cout << endl;\r
 \r
-    puts("GPU module was compiled for the following GPU archs:");\r
-    printf("    BIN: %s\n", CUDA_ARCH_BIN);\r
-    printf("    PTX: %s\n\n", CUDA_ARCH_PTX);\r
+    cout << "GPU module was compiled for the following GPU archs:" << endl;\r
+    cout << "    BIN: " << CUDA_ARCH_BIN << '\n';\r
+    cout << "    PTX: " << CUDA_ARCH_PTX << '\n';\r
+\r
+    cout << endl;\r
 \r
     int deviceCount = getCudaEnabledDeviceCount();\r
-    printf("CUDA device count: %d\n\n", deviceCount);\r
+    cout << "CUDA device count: " << deviceCount << '\n';\r
+\r
+    cout << endl;\r
 \r
     for (int i = 0; i < deviceCount; ++i)\r
     {\r
         DeviceInfo info(i);\r
 \r
-        printf("Device %d:\n", i);\r
-        printf("    Name: %s\n", info.name().c_str());\r
-        printf("    Compute capability version: %d.%d\n", info.majorVersion(), info.minorVersion());\r
-        printf("    Multi Processor Count: %d\n", info.multiProcessorCount());\r
-        printf("    Total memory: %d Mb\n", static_cast<int>(static_cast<int>(info.totalMemory() / 1024.0) / 1024.0));\r
-        printf("    Free  memory: %d Mb\n", static_cast<int>(static_cast<int>(info.freeMemory() / 1024.0) / 1024.0));\r
+        cout << "Device [" << i << "] \n";\r
+        cout << "\t Name: " << info.name() << '\n';\r
+        cout << "\t Compute capability: " << info.majorVersion() << '.' << info.minorVersion()<< '\n';\r
+        cout << "\t Multi Processor Count: " << info.multiProcessorCount() << '\n';\r
+        cout << "\t Total memory: " << static_cast<int>(static_cast<int>(info.totalMemory() / 1024.0) / 1024.0) << " Mb \n";\r
+        cout << "\t Free  memory: " << static_cast<int>(static_cast<int>(info.freeMemory() / 1024.0) / 1024.0) << " Mb \n";\r
         if (!info.isCompatible())\r
-            puts("    !!! This device is NOT compatible with current GPU module build\n");\r
-        printf("\n");\r
+            cout << "\t !!! This device is NOT compatible with current GPU module build \n";\r
+\r
+        cout << endl;\r
     }\r
+#endif\r
 }\r
 \r
-enum OutputLevel\r
-{\r
-    OutputLevelNone,\r
-    OutputLevelCompact,\r
-    OutputLevelFull\r
-};\r
-\r
-extern OutputLevel nvidiaTestOutputLevel;\r
-\r
 int main(int argc, char** argv)\r
 {\r
     try\r
     {\r
-        CommandLineParser parser(argc, (const char**)argv,\r
-                                 "{ print_info_only | print_info_only | false | Print information about system and exit }"\r
-                                 "{ device | device | -1 | Device on which tests will be executed (-1 means all devices) }"\r
-                                 "{ nvtest_output_level | nvtest_output_level | compact | NVidia test verbosity level }");\r
+        CommandLineParser cmd(argc, (const char**)argv,\r
+            "{ print_info_only | print_info_only | false | Print information about system and exit }"\r
+            "{ device | device | -1 | Device on which tests will be executed (-1 means all devices) }"\r
+            "{ nvtest_output_level | nvtest_output_level | compact | NVidia test verbosity level }"\r
+        );\r
 \r
-        printInfo();\r
+        printOsInfo();\r
+        printCudaInfo();\r
 \r
-        if (parser.get<bool>("print_info_only"))\r
+        if (cmd.get<bool>("print_info_only"))\r
             return 0;\r
 \r
-        int device = parser.get<int>("device");\r
+        int device = cmd.get<int>("device");\r
         if (device < 0)\r
         {\r
             DeviceManager::instance().loadAll();\r
-            std::cout << "Run tests on all supported devices\n" << std::endl;\r
+\r
+            cout << "Run tests on all supported devices \n" << endl;\r
         }\r
         else\r
         {\r
             DeviceManager::instance().load(device);\r
-            std::cout << "Run tests on device " << device << '\n' << std::endl;\r
+\r
+            DeviceInfo info(device);\r
+            cout << "Run tests on device " << device << " [" << info.name() << "] \n" << endl;\r
         }\r
 \r
-        string outputLevel = parser.get<string>("nvtest_output_level");\r
+        string outputLevel = cmd.get<string>("nvtest_output_level");\r
 \r
         if (outputLevel == "none")\r
             nvidiaTestOutputLevel = OutputLevelNone;\r
index d1c3620..15016ca 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __main_test_nvidia_h__
 #define __main_test_nvidia_h__
 
-#include<string>
+#include <string>
 
 enum OutputLevel
 {
@@ -10,6 +10,8 @@ enum OutputLevel
     OutputLevelFull
 };
 
+extern OutputLevel nvidiaTestOutputLevel;
+
 bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel);
 bool nvidia_NPPST_Squared_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel);
 bool nvidia_NPPST_RectStdDev(const std::string& test_data_path, OutputLevel outputLevel);
index bdc043f..5fa1ebb 100644 (file)
@@ -39,7 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -329,7 +331,7 @@ TEST_P(ReprojectImageTo3D, Accuracy)
 \r
     cv::gpu::GpuMat dst;\r
     cv::gpu::reprojectImageTo3D(loadMat(disp, useRoi), dst, Q, 3);\r
-    \r
+\r
     cv::Mat dst_gold;\r
     cv::reprojectImageTo3D(disp, dst_gold, Q, false);\r
 \r
@@ -343,3 +345,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Calib3D, ReprojectImageTo3D, testing::Combine(
     WHOLE_SUBMAT));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index 645967e..c2929fb 100644 (file)
@@ -39,7 +39,7 @@
 //
 //M*/
 
-#include "precomp.hpp"
+#include "test_precomp.hpp"
 
 #ifdef HAVE_CUDA
 
index 45b73d3..8bd5a66 100644 (file)
@@ -39,7 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -98,3 +100,5 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CopyMakeBorder, testing::Combine(
     WHOLE_SUBMAT));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index 6502c4a..09c6be1 100644 (file)
@@ -39,7 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -3396,3 +3398,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Core, Reduce, testing::Combine(
     WHOLE_SUBMAT));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index d8ed864..b461d4b 100644 (file)
@@ -39,7 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -984,3 +986,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Features2D, BruteForceMatcher, testing::Combine(
     testing::Values(UseMask(false), UseMask(true))));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index 9df6ee2..0781970 100644 (file)
@@ -39,7 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -552,3 +554,5 @@ INSTANTIATE_TEST_CASE_P(GPU_Filter, Filter2D, testing::Combine(
     WHOLE_SUBMAT));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index eb8b2f7..b37d080 100644 (file)
 //
 //M*/
 
-#include "precomp.hpp"
+#include "test_precomp.hpp"
 
-#include <iostream>
-using namespace std;
+#ifdef HAVE_CUDA
 
+using namespace std;
 using namespace cv;
 
 struct CompactPoints : testing::TestWithParam<gpu::DeviceInfo>
@@ -85,3 +85,5 @@ TEST_P(CompactPoints, CanCompactizeSmallInput)
 }
 
 INSTANTIATE_TEST_CASE_P(GPU_GlobalMotion, CompactPoints, ALL_DEVICES);
+
+#endif // HAVE_CUDA
index 4dd419a..8627957 100644 (file)
@@ -40,7 +40,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -323,3 +325,5 @@ INSTANTIATE_TEST_CASE_P(GPU_GpuMat, ConvertTo, testing::Combine(
     WHOLE_SUBMAT));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index 4d67de5..7a616a2 100644 (file)
@@ -39,7 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -1186,3 +1188,5 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HoughLines, testing::Combine(
                     std::string("../cv/shared/pic6.png"))));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index c88109a..46f6f4e 100644 (file)
@@ -39,9 +39,7 @@
 // the use of this software, even if advised of the possibility of such damage.
 //M*/
 
-#include "precomp.hpp"
-#include <string>
-#include <iostream>
+#include "test_precomp.hpp"
 
 #ifdef HAVE_CUDA
 
@@ -199,4 +197,4 @@ TEST_P(Labeling, ConnectedComponents)
 
 INSTANTIATE_TEST_CASE_P(ConnectedComponents, Labeling, ALL_DEVICES);
 
-#endif
\ No newline at end of file
+#endif // HAVE_CUDA
index 386a66c..3de3557 100644 (file)
 //\r
 //M*/\r
 \r
-#include <main_test_nvidia.h>\r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
+\r
+OutputLevel nvidiaTestOutputLevel = OutputLevelCompact;\r
 \r
 #ifdef HAVE_CUDA\r
 \r
 using namespace cvtest;\r
 using namespace testing;\r
 \r
-//enum OutputLevel\r
-//{\r
-//    OutputLevelNone,\r
-//    OutputLevelCompact,\r
-//    OutputLevelFull\r
-//};\r
-\r
 struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>\r
 {\r
     cv::gpu::DeviceInfo devInfo;\r
@@ -73,8 +67,6 @@ struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>
 struct NPPST : NVidiaTest {};\r
 struct NCV : NVidiaTest {};\r
 \r
-OutputLevel nvidiaTestOutputLevel = OutputLevelCompact;\r
-\r
 //TEST_P(NPPST, Integral)\r
 //{\r
 //    bool res = nvidia_NPPST_Integral_Image(path, nvidiaTestOutputLevel);\r
index 927762b..957ee11 100644 (file)
@@ -39,8 +39,9 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
-#include <string>\r
+#include "test_precomp.hpp"\r
+\r
+#ifdef HAVE_CUDA\r
 \r
 namespace {\r
 \r
@@ -302,13 +303,13 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int)
 \r
 TEST_P(LBP_Read_classifier, Accuracy)\r
 {\r
-    cv::gpu::CascadeClassifier_GPU classifier;
+    cv::gpu::CascadeClassifier_GPU classifier;\r
     std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";\r
     ASSERT_TRUE(classifier.load(classifierXmlPath));\r
 }\r
 \r
-INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,
-                        testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
+INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,\r
+                        testing::Combine(ALL_DEVICES, testing::Values<int>(0)));\r
 \r
 \r
 PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int)\r
@@ -344,7 +345,7 @@ TEST_P(LBP_classify, Accuracy)
     for (; it != rects.end(); ++it)\r
         cv::rectangle(markedImage, *it, CV_RGB(0, 0, 255));\r
 \r
-    cv::gpu::CascadeClassifier_GPU gpuClassifier;
+    cv::gpu::CascadeClassifier_GPU gpuClassifier;\r
     ASSERT_TRUE(gpuClassifier.load(classifierXmlPath));\r
 \r
     cv::gpu::GpuMat gpu_rects;\r
@@ -352,23 +353,25 @@ TEST_P(LBP_classify, Accuracy)
     int count = gpuClassifier.detectMultiScale(tested, gpu_rects);\r
 \r
     cv::Mat downloaded(gpu_rects);\r
-    const cv::Rect* faces = downloaded.ptr<cv::Rect>();
+    const cv::Rect* faces = downloaded.ptr<cv::Rect>();\r
     for (int i = 0; i < count; i++)\r
     {\r
         cv::Rect r = faces[i];\r
 \r
 #if defined (LOG_CASCADE_STATISTIC)\r
-        std::cout << r.x << " " << r.y  << " " << r.width << " " << r.height << std::endl;
+        std::cout << r.x << " " << r.y  << " " << r.width << " " << r.height << std::endl;\r
         cv::rectangle(markedImage, r , CV_RGB(255, 0, 0));\r
-#endif
+#endif\r
     }\r
 \r
 #if defined (LOG_CASCADE_STATISTIC)\r
-    cv::imshow("Res", markedImage); cv::waitKey();
+    cv::imshow("Res", markedImage); cv::waitKey();\r
 #endif\r
 }\r
 \r
 INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify,\r
-                        testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
+                        testing::Combine(ALL_DEVICES, testing::Values<int>(0)));\r
 \r
 } // namespace\r
+\r
+#endif // HAVE_CUDA\r
index dfa7246..34acf2a 100644 (file)
@@ -39,4 +39,4 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
index 753367c..f6933d5 100644 (file)
@@ -59,6 +59,7 @@
 #include <stdexcept>\r
 \r
 #include "cvconfig.h"\r
+\r
 #include "opencv2/core/core.hpp"\r
 #include "opencv2/highgui/highgui.hpp"\r
 #include "opencv2/calib3d/calib3d.hpp"\r
@@ -72,6 +73,7 @@
 \r
 #include "utility.hpp"\r
 #include "interpolation.hpp"\r
+#include "main_test_nvidia.h"\r
 \r
 #ifdef HAVE_CUDA\r
     #include <cuda.h>\r
index d0bf37b..1abd784 100644 (file)
@@ -39,7 +39,7 @@
 //
 //M*/
 
-#include "precomp.hpp"
+#include "test_precomp.hpp"
 
 #ifdef HAVE_CUDA
 
index c61a899..b83e5db 100644 (file)
@@ -39,7 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
 \r
 #ifdef HAVE_CUDA\r
 \r
index 7a7aaca..73b8d9f 100644 (file)
@@ -39,8 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
-#include <iostream>\r
+#include "test_precomp.hpp"\r
 \r
 #ifdef HAVE_CUDA\r
 \r
index cb31c64..e878e6d 100644 (file)
@@ -39,7 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
 \r
 #ifdef HAVE_CUDA\r
 \r
index 0ee66ba..ca9442d 100644 (file)
@@ -39,7 +39,9 @@
 //
 //M*/
 
-#include "precomp.hpp"
+#include "test_precomp.hpp"
+
+#ifdef HAVE_CUDA
 
 //#define DUMP
 
@@ -865,3 +867,5 @@ TEST_P(VideoReader, Regression)
 INSTANTIATE_TEST_CASE_P(GPU_Video, VideoReader, testing::Combine(
     ALL_DEVICES,
     testing::Values(std::string("768x576.avi"), std::string("1920x1080.avi"))));
+
+#endif // HAVE_CUDA
index 262937f..c81fef3 100644 (file)
@@ -39,7 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
 \r
 #ifdef HAVE_CUDA\r
 \r
index f143170..83c170f 100644 (file)
@@ -39,7 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
 \r
 #ifdef HAVE_CUDA\r
 \r
index 148c9d2..cf3b0fc 100644 (file)
@@ -39,7 +39,7 @@
 //\r
 //M*/\r
 \r
-#include "precomp.hpp"\r
+#include "test_precomp.hpp"\r
 \r
 using namespace std;\r
 using namespace cv;\r
@@ -182,105 +182,6 @@ void DeviceManager::loadAll()
     }\r
 }\r
 \r
-class DevicesGenerator : public ParamGeneratorInterface<DeviceInfo>\r
-{\r
-public:\r
-    ~DevicesGenerator();\r
-\r
-    ParamIteratorInterface<DeviceInfo>* Begin() const;\r
-    ParamIteratorInterface<DeviceInfo>* End() const;\r
-\r
-private:\r
-    class Iterator : public ParamIteratorInterface<DeviceInfo>\r
-    {\r
-    public:\r
-        Iterator(const ParamGeneratorInterface<DeviceInfo>* base, vector<DeviceInfo>::const_iterator iterator);\r
-\r
-        virtual ~Iterator();\r
-\r
-        virtual const ParamGeneratorInterface<DeviceInfo>* BaseGenerator() const;\r
-\r
-        virtual void Advance();\r
-\r
-        virtual ParamIteratorInterface<DeviceInfo>* Clone() const;\r
-\r
-        virtual const DeviceInfo* Current() const;\r
-\r
-        virtual bool Equals(const ParamIteratorInterface<DeviceInfo>& other) const;\r
-\r
-    private:\r
-        Iterator(const Iterator& other);\r
-\r
-        const ParamGeneratorInterface<DeviceInfo>* const base_;\r
-        vector<DeviceInfo>::const_iterator iterator_;\r
-\r
-        mutable DeviceInfo value_;\r
-    };\r
-};\r
-\r
-DevicesGenerator::~DevicesGenerator()\r
-{\r
-}\r
-\r
-ParamIteratorInterface<DeviceInfo>* DevicesGenerator::Begin() const\r
-{\r
-    return new Iterator(this, DeviceManager::instance().values().begin());\r
-}\r
-\r
-ParamIteratorInterface<DeviceInfo>* DevicesGenerator::End() const\r
-{\r
-    return new Iterator(this, DeviceManager::instance().values().end());\r
-}\r
-\r
-DevicesGenerator::Iterator::Iterator(const ParamGeneratorInterface<DeviceInfo>* base, vector<DeviceInfo>::const_iterator iterator)\r
-    : base_(base), iterator_(iterator)\r
-{\r
-}\r
-\r
-DevicesGenerator::Iterator::~Iterator()\r
-{\r
-}\r
-\r
-const ParamGeneratorInterface<DeviceInfo>* DevicesGenerator::Iterator::BaseGenerator() const\r
-{\r
-    return base_;\r
-}\r
-\r
-void DevicesGenerator::Iterator::Advance()\r
-{\r
-    ++iterator_;\r
-}\r
-\r
-ParamIteratorInterface<DeviceInfo>* DevicesGenerator::Iterator::Clone() const\r
-{\r
-    return new Iterator(*this);\r
-}\r
-\r
-const DeviceInfo* DevicesGenerator::Iterator::Current() const\r
-{\r
-    value_ = *iterator_;\r
-    return &value_;\r
-}\r
-\r
-bool DevicesGenerator::Iterator::Equals(const ParamIteratorInterface<DeviceInfo>& other) const\r
-{\r
-    GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\r
-        << "The program attempted to compare iterators "\r
-        << "from different generators." << endl;\r
-\r
-    return iterator_ == CheckedDowncastToActualType<const Iterator>(&other)->iterator_;\r
-}\r
-\r
-DevicesGenerator::Iterator::Iterator(const Iterator& other) :\r
-    ParamIteratorInterface<DeviceInfo>(), base_(other.base_), iterator_(other.iterator_)\r
-{\r
-}\r
-\r
-ParamGenerator<DeviceInfo> DevicesGenerator_()\r
-{\r
-  return ParamGenerator<DeviceInfo>(new DevicesGenerator);\r
-}\r
-\r
 //////////////////////////////////////////////////////////////////////\r
 // Additional assertion\r
 \r
index b36f177..f509b78 100644 (file)
@@ -94,9 +94,7 @@ private:
     std::vector<cv::gpu::DeviceInfo> devices_;\r
 };\r
 \r
-testing::internal::ParamGenerator<cv::gpu::DeviceInfo> DevicesGenerator_();\r
-\r
-#define ALL_DEVICES DevicesGenerator_()\r
+#define ALL_DEVICES testing::ValuesIn(DeviceManager::instance().values())\r
 \r
 //////////////////////////////////////////////////////////////////////\r
 // Additional assertion\r