fixed parsing of CC in gpu module
authorAlexey Spizhevoy <no@email>
Thu, 20 Jan 2011 14:34:27 +0000 (14:34 +0000)
committerAlexey Spizhevoy <no@email>
Thu, 20 Jan 2011 14:34:27 +0000 (14:34 +0000)
modules/gpu/src/initialization.cpp
tests/gpu/src/arithm.cpp

index d754c87..5142923 100644 (file)
@@ -145,16 +145,17 @@ namespace
     template <typename Comparer>\r
     bool compare(const std::string& str, int x, Comparer cmp)\r
     {\r
-        std::stringstream stream(str);\r
+        if (str.find_first_not_of(" ") == string::npos)\r
+            return false;\r
 \r
+        std::stringstream stream(str);\r
         int val;\r
-        stream >> val;\r
 \r
-        while (!stream.eof() && !stream.fail())\r
+        while (!stream.eof())\r
         {\r
+            stream >> val;\r
             if (cmp(val, x))\r
                 return true;\r
-            stream >> val;\r
         }\r
 \r
         return false;\r
index 7dc7ba3..5b4230c 100644 (file)
@@ -918,7 +918,7 @@ struct CV_GpuCountNonZeroTest: CvTest
 \r
         if (n != n_gold)\r
         {\r
-            ts->printf(CvTS::CONSOLE, "%d %d %d %d %d\n", n, n_gold, depth, cols, rows);\r
+            ts->printf(CvTS::LOG, "%d %d %d %d %d\n", n, n_gold, depth, cols, rows);\r
             n_gold = cv::countNonZero(src);\r
         }\r
 \r