aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-08-07 17:59:06 -0700
committerJeff Garzik <jgarzik@exmulti.com>2012-08-07 17:59:06 -0700
commit2c006b0b3e6a94fc0fdac80ff2db3af93f768064 (patch)
tree4868d0c22eb9053096009763e7e06d1120c3eee3
parentc995995eb8627a56079180fceb85323e1b73495e (diff)
parentc5f90cd88b61ff28327eed4981903bdf72027cc5 (diff)
Merge pull request #1658 from TheBlueMatt/qttest
Fix several issues in the Qt unit tests.
-rw-r--r--src/makefile.linux-mingw7
-rw-r--r--src/qt/guiutil.cpp6
-rw-r--r--src/qt/sendcoinsdialog.cpp4
-rw-r--r--src/qt/test/test_main.cpp7
-rw-r--r--src/qt/test/uritests.cpp2
5 files changed, 15 insertions, 11 deletions
diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw
index fc22bb76ee..51439c7b7c 100644
--- a/src/makefile.linux-mingw
+++ b/src/makefile.linux-mingw
@@ -7,11 +7,12 @@ DEPSDIR:=/usr/i586-mingw32msvc
USE_UPNP:=0
INCLUDEPATHS= \
+ -I"$(CURDIR)" \
+ -I"$(CURDIR)"/obj \
-I"$(DEPSDIR)/boost_1_49_0" \
-I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \
-I"$(DEPSDIR)/openssl-1.0.1b/include" \
- -I"$(DEPSDIR)" \
- -I"$(CURDIR)"/obj \
+ -I"$(DEPSDIR)"
LIBPATHS= \
-L"$(DEPSDIR)/boost_1_49_0/stage/lib" \
@@ -88,7 +89,7 @@ obj-test/%.o: test/%.cpp $(HEADERS)
i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%))
- i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS)
+ i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework-mt-s $(LIBS)
clean:
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 558eff6d5d..d2d7716dbd 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -4,7 +4,6 @@
#include "bitcoinunits.h"
#include "util.h"
#include "init.h"
-#include "base58.h"
#include <QString>
#include <QDateTime>
@@ -81,11 +80,6 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
if(uri.scheme() != QString("bitcoin"))
return false;
- // check if the address is valid
- CBitcoinAddress addressFromUri(uri.path().toStdString());
- if (!addressFromUri.IsValid())
- return false;
-
SendCoinsRecipient rv;
rv.address = uri.path();
rv.amount = 0;
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 2c46ea5a70..789681ad90 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -7,6 +7,7 @@
#include "sendcoinsentry.h"
#include "guiutil.h"
#include "askpassphrasedialog.h"
+#include "base58.h"
#include <QMessageBox>
#include <QLocale>
@@ -273,6 +274,9 @@ bool SendCoinsDialog::handleURI(const QString &uri)
// URI has to be valid
if (GUIUtil::parseBitcoinURI(uri, &rv))
{
+ CBitcoinAddress address(rv.address.toStdString());
+ if (!address.IsValid())
+ return false;
pasteEntry(rv);
return true;
}
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 5b11e39ea3..af2d358fc4 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -6,6 +6,11 @@
// This is all you need to run all the tests
int main(int argc, char *argv[])
{
+ bool fInvalid = false;
+
URITests test1;
- QTest::qExec(&test1);
+ if (QTest::qExec(&test1) != 0)
+ fInvalid = true;
+
+ return fInvalid;
}
diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp
index a281c39ca5..4662f5ed31 100644
--- a/src/qt/test/uritests.cpp
+++ b/src/qt/test/uritests.cpp
@@ -47,7 +47,7 @@ void URITests::uriTests()
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=100&label=Wikipedia Example"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
- QVERIFY(rv.amount == 10000000000);
+ QVERIFY(rv.amount == 10000000000LL);
QVERIFY(rv.label == QString("Wikipedia Example"));
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address"));