#include "BlackPointEstimatorTest.h"
#include <zxing/common/IllegalArgumentException.h>
-#include <valarray>
+#include <vector>
namespace zxing {
using namespace std;
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);
}
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");