1
- #include " urltests .h"
1
+ #include " uritests .h"
2
2
#include " ../guiutil.h"
3
3
#include " ../walletmodel.h"
4
4
@@ -13,59 +13,59 @@ struct SendCoinsRecipient
13
13
};
14
14
*/
15
15
16
- void URLTests::urlTests ()
16
+ void URITests::uriTests ()
17
17
{
18
18
SendCoinsRecipient rv;
19
- QUrl url ;
20
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-dontexist=" ));
21
- QVERIFY (!GUIUtil::parseBitcoinURL (url , &rv));
19
+ QUrl uri ;
20
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-dontexist=" ));
21
+ QVERIFY (!GUIUtil::parseBitcoinURI (uri , &rv));
22
22
23
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?dontexist=" ));
24
- QVERIFY (GUIUtil::parseBitcoinURL (url , &rv));
23
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?dontexist=" ));
24
+ QVERIFY (GUIUtil::parseBitcoinURI (uri , &rv));
25
25
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
26
26
QVERIFY (rv.label == QString ());
27
27
QVERIFY (rv.amount == 0 );
28
28
29
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?label=Wikipedia Example Address" ));
30
- QVERIFY (GUIUtil::parseBitcoinURL (url , &rv));
29
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?label=Wikipedia Example Address" ));
30
+ QVERIFY (GUIUtil::parseBitcoinURI (uri , &rv));
31
31
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
32
32
QVERIFY (rv.label == QString (" Wikipedia Example Address" ));
33
33
QVERIFY (rv.amount == 0 );
34
34
35
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=0.001" ));
36
- QVERIFY (GUIUtil::parseBitcoinURL (url , &rv));
35
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=0.001" ));
36
+ QVERIFY (GUIUtil::parseBitcoinURI (uri , &rv));
37
37
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
38
38
QVERIFY (rv.label == QString ());
39
39
QVERIFY (rv.amount == 100000 );
40
40
41
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1.001" ));
42
- QVERIFY (GUIUtil::parseBitcoinURL (url , &rv));
41
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1.001" ));
42
+ QVERIFY (GUIUtil::parseBitcoinURI (uri , &rv));
43
43
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
44
44
QVERIFY (rv.label == QString ());
45
45
QVERIFY (rv.amount == 100100000 );
46
46
47
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=100&label=Wikipedia Example" ));
48
- QVERIFY (GUIUtil::parseBitcoinURL (url , &rv));
47
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=100&label=Wikipedia Example" ));
48
+ QVERIFY (GUIUtil::parseBitcoinURI (uri , &rv));
49
49
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
50
50
QVERIFY (rv.amount == 10000000000 );
51
51
QVERIFY (rv.label == QString (" Wikipedia Example" ));
52
52
53
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address" ));
54
- QVERIFY (GUIUtil::parseBitcoinURL (url , &rv));
53
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address" ));
54
+ QVERIFY (GUIUtil::parseBitcoinURI (uri , &rv));
55
55
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
56
56
QVERIFY (rv.label == QString ());
57
57
58
- QVERIFY (GUIUtil::parseBitcoinURL (" bitcoin://175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address" , &rv));
58
+ QVERIFY (GUIUtil::parseBitcoinURI (" bitcoin://175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?message=Wikipedia Example Address" , &rv));
59
59
QVERIFY (rv.address == QString (" 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W" ));
60
60
QVERIFY (rv.label == QString ());
61
61
62
62
// We currently dont implement the message paramenter (ok, yea, we break spec...)
63
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address" ));
64
- QVERIFY (!GUIUtil::parseBitcoinURL (url , &rv));
63
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address" ));
64
+ QVERIFY (!GUIUtil::parseBitcoinURI (uri , &rv));
65
65
66
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000&label=Wikipedia Example" ));
67
- QVERIFY (!GUIUtil::parseBitcoinURL (url , &rv));
66
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000&label=Wikipedia Example" ));
67
+ QVERIFY (!GUIUtil::parseBitcoinURI (uri , &rv));
68
68
69
- url .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000.0&label=Wikipedia Example" ));
70
- QVERIFY (!GUIUtil::parseBitcoinURL (url , &rv));
69
+ uri .setUrl (QString (" bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000.0&label=Wikipedia Example" ));
70
+ QVERIFY (!GUIUtil::parseBitcoinURI (uri , &rv));
71
71
}
0 commit comments