fixed linker error for QZXingTests when compiled with MSVC. Minor styling edits in TestCase.cpp

This commit is contained in:
favoritas37 2017-01-23 18:05:57 +02:00
parent fe26b2112e
commit 3397ee4a2b
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -2,12 +2,16 @@
#include <stdlib.h> /* srand, rand */
#include <time.h> /* 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;
}
}