C++ port made more compatible with uSTL (no functional changes).
[zxing.git] / cpp / core / tests / src / common / BlackPointEstimatorTest.cpp
index 23813c0..f79b28a 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "BlackPointEstimatorTest.h"
 #include <zxing/common/IllegalArgumentException.h>
-#include <valarray>
+#include <vector>
 
 namespace zxing {
 using namespace std;
@@ -28,7 +28,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(BlackPointEstimatorTest);
 
 void BlackPointEstimatorTest::testBasic() {
   int histogramRaw[] = { 0, 0, 11, 43, 37, 18, 3, 1, 0, 0, 13, 36, 24, 0, 11, 2 };
-  valarray<int> histogram(histogramRaw, 16);
+  vector<int> histogram(histogramRaw, histogramRaw+16);
   size_t point = GlobalHistogramBinarizer::estimate(histogram);
   CPPUNIT_ASSERT_EQUAL((size_t)8, point);
 }
@@ -36,7 +36,7 @@ void BlackPointEstimatorTest::testBasic() {
 void BlackPointEstimatorTest::testTooLittleRange() {
   try {
     int histogramRaw[] = { 0, 0, 0, 0, 0, 0, 1, 43, 48, 18, 3, 1, 0, 0, 0, 0 };
-    valarray<int> histogram(histogramRaw, 16);
+    vector<int> histogram(histogramRaw, histogramRaw+16);
     GlobalHistogramBinarizer::estimate(histogram);
     CPPUNIT_FAIL("Should have thrown an exception");