diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-02-17 15:26:20 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-02-17 15:32:51 +0100 |
commit | 23b3cf9d10b8e999c46238631239005f2367a5f9 (patch) | |
tree | 80108137c3922024f5f7779ae5436ada4b803a23 /src/qt/test | |
parent | 39231e91052bff032525d99dbe890f742b6180fe (diff) |
Restructure IPC URL handling (fixes #851)
Diffstat (limited to 'src/qt/test')
-rw-r--r-- | src/qt/test/urltests.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/qt/test/urltests.cpp b/src/qt/test/urltests.cpp index 5ecc846203..1f11795a9b 100644 --- a/src/qt/test/urltests.cpp +++ b/src/qt/test/urltests.cpp @@ -18,51 +18,54 @@ void URLTests::urlTests() SendCoinsRecipient rv; QUrl url; url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-dontexist=")); - QVERIFY(!GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(!GUIUtil::parseBitcoinURL(url, &rv)); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?dontexist=")); - QVERIFY(GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(GUIUtil::parseBitcoinURL(url, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 0); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?label=Wikipedia Example Address")); - QVERIFY(GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(GUIUtil::parseBitcoinURL(url, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.label == QString("Wikipedia Example Address")); QVERIFY(rv.amount == 0); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=0.001")); - QVERIFY(GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(GUIUtil::parseBitcoinURL(url, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 100000); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1.001")); - QVERIFY(GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(GUIUtil::parseBitcoinURL(url, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 100100000); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=100&label=Wikipedia Example")); - QVERIFY(GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(GUIUtil::parseBitcoinURL(url, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.amount == 10000000000); QVERIFY(rv.label == QString("Wikipedia Example")); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address")); - QVERIFY(GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(GUIUtil::parseBitcoinURL(url, &rv)); QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.label == QString()); + + QVERIFY(GUIUtil::parseBitcoinURL("bitcoin://175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address", &rv)); + QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")); QVERIFY(rv.label == QString()); // We currently dont implement the message paramenter (ok, yea, we break spec...) url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address")); - QVERIFY(!GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(!GUIUtil::parseBitcoinURL(url, &rv)); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000&label=Wikipedia Example")); - QVERIFY(!GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(!GUIUtil::parseBitcoinURL(url, &rv)); url.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000.0&label=Wikipedia Example")); - QVERIFY(!GUIUtil::parseBitcoinURL(&url, &rv)); + QVERIFY(!GUIUtil::parseBitcoinURL(url, &rv)); } |