summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-17 06:11:48 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-17 06:11:48 (GMT)
commitf8d9c9e291be6a484cc688f705721548bd4b999f (patch)
tree502b23f89e9549ae85ccb21751681e219c07d1a3
parent31eba380348209feeb0a4e323d1b99e29bd2be09 (diff)
Add debug info
-rw-r--r--webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp2
-rw-r--r--webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp20
-rw-r--r--webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h9
3 files changed, 22 insertions, 9 deletions
diff --git a/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp b/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp
index e22ccdb..5183284 100644
--- a/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp
+++ b/webengineviewer/src/checkphishingurl/autotests/createphishingurldatabasejobtest.cpp
@@ -99,7 +99,7 @@ void CreatePhishingUrlDataBaseJobTest::shouldParseResult_data()
value.newClientState = QStringLiteral("ChAIBRADGAEiAzAwMSiAEDABEAFGpqhd");
value.sha256 = QStringLiteral("YSgoRtsRlgHDqDA3LAhM1gegEpEzs1TjzU33vqsR8iM=");
value.additionList = additionList;
- value.removalList = removalList;
+ //value.removalList = removalList;
QTest::newRow("test1") << QStringLiteral("test1.json") << WebEngineViewer::CreatePhishingUrlDataBaseJob::ValidData << value;
}
diff --git a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
index dc0937d..39b3147 100644
--- a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
+++ b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.cpp
@@ -338,8 +338,26 @@ bool UpdateDataBaseInfo::operator==(const UpdateDataBaseInfo &other) const {
qDebug() << " platformType "<<platformType << " other.platformType "<< other.platformType;
qDebug() << " newClientState "<<newClientState << " other.newClientState "<< other.newClientState;
qDebug() << " threatType "<<threatType << " other.threatType "<< other.threatType;
+ qDebug() << " removalList" << removalList.count() << " other.removalList " << other.removalList.count();
+ qDebug() << " additionList" << additionList.count() << " other.additionList " << other.additionList.count();
+ }
+ return val;
+}
+bool Removal::operator==(const Removal &other) const {
+ bool value = (indexes == other.indexes);
+ if (!value) {
+ qDebug() << " indexes "<<indexes << " other.indexes " << other.indexes;
+ }
+ return value;
+}
+bool Addition::operator==(const Addition &other) const {
+ bool value = (hashString == other.hashString) &&
+ (prefixSize == other.prefixSize);
+ if (!value) {
+ qDebug() << "hashString " << hashString << " other.hashString "<<other.hashString;
+ qDebug() << "prefixSize " << prefixSize << " other.prefixSize "<<other.prefixSize;
}
- return val;
+ return value;
}
diff --git a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h
index 1671483..f80102f 100644
--- a/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h
+++ b/webengineviewer/src/checkphishingurl/createphishingurldatabasejob.h
@@ -38,10 +38,7 @@ struct Addition {
bool isValid() const {
return !hashString.isEmpty() && (prefixSize > 0);
}
- bool operator==(const Addition &other) const {
- return (hashString == other.hashString) &&
- (prefixSize == other.prefixSize);
- }
+ bool operator==(const Addition &other) const;
QByteArray hashString;
int prefixSize;
@@ -53,9 +50,7 @@ struct Removal {
}
- bool operator==(const Removal &other) const {
- return (indexes == other.indexes);
- }
+ bool operator==(const Removal &other) const;
bool isValid() const {
return !indexes.isEmpty();
}