mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-12 19:06:50 +00:00
Fixed compiling tests & fixed warnings (except THROWS macro)
This commit is contained in:
parent
076dd575bd
commit
6c6999256c
@ -65,7 +65,6 @@ StringUtils::guessEncoding(zxing::byte* bytes, int length,
|
||||
//int isoHighChars = 0;
|
||||
int isoHighOther = 0;
|
||||
|
||||
typedef zxing::byte byte;
|
||||
boolean utf8bom = length > 3 &&
|
||||
bytes[0] == (zxing::byte) 0xEF &&
|
||||
bytes[1] == (zxing::byte) 0xBB &&
|
||||
|
@ -1,8 +1,10 @@
|
||||
#include "DecodeValidator.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QDirIterator>
|
||||
#include <QFileInfo>
|
||||
#include <QTextStream>
|
||||
|
||||
#define LOG_OUTPUT_DIVIDER "##############################################"
|
||||
#define LOG_SECTOR_TITLE(a) '\n' << LOG_OUTPUT_DIVIDER\
|
||||
@ -123,13 +125,13 @@ void DecodeValidator::printResults()
|
||||
if(failedResultLogs.size())
|
||||
qDebug() << " failed image files:";
|
||||
|
||||
for(size_t i=0; i<failedResultLogs.size(); i++)
|
||||
for(int i=0; i<failedResultLogs.size(); i++)
|
||||
qDebug() << '\t' << failedResultLogs[i];
|
||||
|
||||
if(inconsistentResultLogs.size())
|
||||
qDebug() << " inconsistent image files:";
|
||||
|
||||
for(size_t i=0; i<inconsistentResultLogs.size(); i++)
|
||||
for(int i=0; i<inconsistentResultLogs.size(); i++)
|
||||
qDebug() << '\t' << inconsistentResultLogs[i];
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <QtGlobal>
|
||||
#include <zxing/qrcode/decoder/Mode.h>
|
||||
#include "backward.hpp"
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
namespace zxing{
|
||||
@ -45,7 +46,7 @@ private:
|
||||
return QString::number(item);
|
||||
}
|
||||
|
||||
static QString itemToString(byte item) {
|
||||
static QString itemToString(zxing::byte item) {
|
||||
return QString::number(item);
|
||||
}
|
||||
|
||||
@ -109,13 +110,13 @@ protected:
|
||||
}
|
||||
|
||||
void assertDataEquals(const std::string &message,
|
||||
const std::vector<byte> &expected,
|
||||
const std::vector<byte> & received)
|
||||
const std::vector<zxing::byte> &expected,
|
||||
const std::vector<zxing::byte> & received)
|
||||
{
|
||||
if(expected.size() != received.size())
|
||||
assertTrue(false);
|
||||
|
||||
for (int i = 0; i < expected.size(); i++) {
|
||||
for (size_t i = 0; i < expected.size(); i++) {
|
||||
if (expected[i] != received[i]) {
|
||||
qDebug() << QString::fromStdString(message) << ". Mismatch at " << QString::number(i) /*<< ". Expected " + arrayToString(expected) + ", got " +
|
||||
arrayToString(Arrays.copyOf(received, expected.length)))*/;
|
||||
@ -125,13 +126,13 @@ protected:
|
||||
}
|
||||
|
||||
void assertDataEquals(const std::string &message,
|
||||
const std::vector<byte> &expected,
|
||||
const ArrayRef<byte> &received)
|
||||
const std::vector<zxing::byte> &expected,
|
||||
const ArrayRef<zxing::byte> &received)
|
||||
{
|
||||
if(expected.size() != received->size())
|
||||
if(int(expected.size()) != received->size())
|
||||
assertTrue(false);
|
||||
|
||||
for (int i = 0; i < expected.size(); i++) {
|
||||
for (size_t i = 0; i < expected.size(); i++) {
|
||||
if (expected[i] != received[i]) {
|
||||
qDebug() << QString::fromStdString(message) << ". Mismatch at " << QString::number(i) /*<< ". Expected " + arrayToString(expected) + ", got " +
|
||||
arrayToString(Arrays.copyOf(received, expected.length)))*/;
|
||||
@ -141,10 +142,10 @@ protected:
|
||||
}
|
||||
|
||||
void assertDataEquals(const std::string &message,
|
||||
const std::vector<byte> &expected,
|
||||
const std::vector<zxing::byte> &expected,
|
||||
const ArrayRef<int> &received)
|
||||
{
|
||||
ArrayRef<byte> received_copy(received->size());
|
||||
ArrayRef<zxing::byte> received_copy(received->size());
|
||||
for(int i=0; i<received_copy->size(); i++)
|
||||
received_copy[i] = received[i];
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "DecodeValidator.h"
|
||||
|
||||
int main(int /*argc*/, char */*argv[]*/)
|
||||
int main(int /*argc*/, char **/*argv[]*/)
|
||||
{
|
||||
DecodeValidator decodeValidator;
|
||||
decodeValidator.executeTests("../../resources/");
|
||||
|
@ -121,8 +121,8 @@ void ReedSolomonTests::testDecoder(Ref<GenericGF> field,
|
||||
referenceMessage.insert(std::end(referenceMessage), std::begin(ecWords), std::end(ecWords));
|
||||
|
||||
for (int j = 0; j < iterations; j++) {
|
||||
for (int i = 0; i < ecWords.size(); i++) {
|
||||
if (i > 10 && i < ecWords.size() / 2 - 10) {
|
||||
for (int i = 0; i < int(ecWords.size()); i++) {
|
||||
if (i > 10 && i < int(ecWords.size()) / 2 - 10) {
|
||||
// performance improvement - skip intermediate cases in long-running tests
|
||||
i += ecWords.size() / 10;
|
||||
}
|
||||
@ -131,7 +131,7 @@ void ReedSolomonTests::testDecoder(Ref<GenericGF> field,
|
||||
corrupt(message, i, field->getSize());
|
||||
|
||||
ArrayRef<int> messageArrayRef(message.size());
|
||||
for(int i=0; i<message.size(); i++)
|
||||
for(int i=0; i<int(message.size()); i++)
|
||||
messageArrayRef[i] = message[i];
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user