update some qt tests

This commit is contained in:
Michel van Kessel
2020-12-21 00:00:52 +01:00
parent 59f0fb2c9a
commit c26702552a
5 changed files with 28 additions and 30 deletions

View File

@@ -435,7 +435,7 @@ d2hj739GDLz0b5KuJ2SG6VknMRQM976w/m2qlq0ccVGaaZ2zMIGfpzL3p6adwx/5\
";
//
// Payment request with amount overflow (amount is set to 21000001 BTC)
// Payment request with amount overflow (amount is set to 21000001 BLK)
//
const char* paymentrequest5_cert2_BASE64 =
"\

View File

@@ -2,17 +2,17 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "paymentservertests.h"
#include <qt/test/paymentservertests.h>
#include "optionsmodel.h"
#include "paymentrequestdata.h"
#include <optionsmodel.h>
#include <qt/test/paymentrequestdata.h>
#include "amount.h"
#include "random.h"
#include "script/script.h"
#include "script/standard.h"
#include "util.h"
#include "utilstrencodings.h"
#include <amount.h>
#include <random.h>
#include <script/script.h>
#include <script/standard.h>
#include <util.h>
#include <utilstrencodings.h>
#include <openssl/x509.h>
#include <openssl/x509_vfy.h>
@@ -188,7 +188,7 @@ void PaymentServerTests::paymentServerTests()
// compares 50001 <= BIP70_MAX_PAYMENTREQUEST_SIZE == false
QCOMPARE(PaymentServer::verifySize(tempFile.size()), false);
// Payment request with amount overflow (amount is set to 21000001 BTC):
// Payment request with amount overflow (amount is set to 21000001 BLK):
data = DecodeBase64(paymentrequest5_cert2_BASE64);
byteArray = QByteArray((const char*)&data[0], data.size());
r.paymentRequest.parse(byteArray);
@@ -196,7 +196,7 @@ void PaymentServerTests::paymentServerTests()
QVERIFY(r.paymentRequest.IsInitialized());
// Extract address and amount from the request
QList<std::pair<CScript, CAmount> > sendingTos = r.paymentRequest.getPayTo();
Q_FOREACH (const PAIRTYPE(CScript, CAmount)& sendingTo, sendingTos) {
for (const PAIRTYPE(CScript, CAmount)& sendingTo: sendingTos) {
CTxDestination dest;
if (ExtractDestination(sendingTo.first, dest))
QCOMPARE(PaymentServer::verifyAmount(sendingTo.second), false);

View File

@@ -5,7 +5,7 @@
#ifndef BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H
#define BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H
#include "../paymentserver.h"
#include <qt/test/../paymentserver.h>
#include <QObject>
#include <QTest>

View File

@@ -3,20 +3,20 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#include <config/bitcoin-config.h>
#endif
#include "bitcoinaddressvalidatortests.h"
#include "chainparams.h"
#include "compattests.h"
#include "guiutiltests.h"
#include <qt/test/bitcoinaddressvalidatortests.h>
#include <chainparams.h>
#include <qt/test/compattests.h>
#include <qt/test/guiutiltests.h>
#include "key.h"
#include "rpcnestedtests.h"
#include "util.h"
#include "uritests.h"
#include <util.h>
#include <qt/test/uritests.h>
#ifdef ENABLE_WALLET
#include "paymentservertests.h"
#include <qt/test/paymentservertests.h>
#endif
#include <QCoreApplication>

View File

@@ -4,12 +4,12 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "uritests.h"
#include <qt/test/uritests.h>
#include "chainparams.h"
#include "config.h"
#include "guiutil.h"
#include "walletmodel.h"
#include <chainparams.h>
#include <config.h>
#include <guiutil.h>
#include <walletmodel.h>
#include <QUrl>
@@ -19,7 +19,7 @@ void URITests::uriTestsBase58()
QString scheme =
QString::fromStdString(Params(CBaseChainParams::MAIN).CashAddrPrefix());
QUrl uri;
uri.setUrl(QString("blackcoin175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-dontexist="));
uri.setUrl(QString("blackcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-dontexist="));
QVERIFY(!GUIUtil::parseBitcoinURI(scheme, uri, &rv));
uri.setUrl(QString("blackcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?dontexist="));
@@ -57,9 +57,7 @@ void URITests::uriTestsBase58()
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
QVERIFY(rv.label == QString());
QVERIFY(GUIUtil::parseBitcoinURI(scheme, "blackcoin://175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?"
"message=Wikipedia Example Address",
&rv));
QVERIFY(GUIUtil::parseBitcoinURI(scheme, "blackcoin://175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address", &rv));
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
QVERIFY(rv.label == QString());