From 3397ee4a2b60eb60674770f3ca74573759a36c35 Mon Sep 17 00:00:00 2001 From: favoritas37 Date: Mon, 23 Jan 2017 18:05:57 +0200 Subject: [PATCH] fixed linker error for QZXingTests when compiled with MSVC. Minor styling edits in TestCase.cpp --- tests/src/QZXingTests/QZXingTests.pro | 4 ++-- tests/src/QZXingTests/TestCase.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/src/QZXingTests/QZXingTests.pro b/tests/src/QZXingTests/QZXingTests.pro index 1cf9ff4..5809b0f 100644 --- a/tests/src/QZXingTests/QZXingTests.pro +++ b/tests/src/QZXingTests/QZXingTests.pro @@ -25,12 +25,12 @@ SOURCES += main.cpp \ DecodeValidator.cpp \ ValidationStats.cpp \ EncodeValidator.cpp \ + TestCase.cpp \ zxing/qrcode/encoder/MatrixUtilTests.cpp \ zxing/qrcode/encoder/MaskUtilTests.cpp \ zxing/qrcode/encoder/BitArrayTests.cpp \ zxing/qrcode/encoder/QRCodeTests.cpp \ zxing/qrcode/encoder/EncoderTests.cpp \ - zxing/common/reedsolomon/ReedSolomonEncoderTests.cpp \ - TestCase.cpp + zxing/common/reedsolomon/ReedSolomonEncoderTests.cpp include(../../../src/QZXing.pri) diff --git a/tests/src/QZXingTests/TestCase.cpp b/tests/src/QZXingTests/TestCase.cpp index a3bca02..d8d9cf7 100644 --- a/tests/src/QZXingTests/TestCase.cpp +++ b/tests/src/QZXingTests/TestCase.cpp @@ -2,12 +2,16 @@ #include /* srand, rand */ #include /* time */ -void zxing::TestCase::initializeRandom() +namespace zxing{ + +void TestCase::initializeRandom() { srand(time(NULL)); } -int zxing::TestCase::generateRandomNumber(int range) +int TestCase::generateRandomNumber(int range) { return rand() % range; } + +}