@@ -17,8 +17,8 @@ BOOST_AUTO_TEST_CASE(GetBalance) {
1717
1818 MyFixture fx;
1919
20- BOOST_REQUIRE_NO_THROW (fx.btc .getbalance ());
21- BOOST_REQUIRE_NO_THROW (fx.btc .getbalance (" " ));
20+ NO_THROW (fx.btc .getbalance ());
21+ NO_THROW (fx.btc .getbalance (" " ));
2222
2323 #ifdef VERBOSE
2424 double response = fx.btc .getbalance ();
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(GetReceivedByAccount) {
3232
3333 MyFixture fx;
3434
35- BOOST_REQUIRE_NO_THROW (fx.btc .getreceivedbyaccount (" " ));
35+ NO_THROW (fx.btc .getreceivedbyaccount (" " ));
3636
3737 #ifdef VERBOSE
3838 double response = fx.btc .getreceivedbyaccount (" " );
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE(GetReceivedByAddress) {
4747
4848 std::string param = " 36m2bHwsUnkpGsZgVAEmeJRf2CeViDm6RV" ;
4949
50- BOOST_REQUIRE_NO_THROW (fx.btc .getreceivedbyaddress (param));
50+ NO_THROW (fx.btc .getreceivedbyaddress (param));
5151
5252 #ifdef VERBOSE
5353 double response = fx.btc .getreceivedbyaddress (param);
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(ListReceivedByAccount) {
6262 MyFixture fx;
6363
6464 std::vector<accountinfo_t > response;
65- BOOST_REQUIRE_NO_THROW (response = fx.btc .listreceivedbyaccount (1 ,true ));
65+ NO_THROW (response = fx.btc .listreceivedbyaccount (1 ,true ));
6666
6767 #ifdef VERBOSE
6868 std::cout << " === listreceivedbyaccount ===" << std::endl;
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(ListReceivedByAddress) {
8080 MyFixture fx;
8181
8282 std::vector<addressinfo_t > response;
83- BOOST_REQUIRE_NO_THROW (response = fx.btc .listreceivedbyaddress (1 ,true ));
83+ NO_THROW (response = fx.btc .listreceivedbyaddress (1 ,true ));
8484
8585 #ifdef VERBOSE
8686 std::cout << " === listreceivedbyaccount ===" << std::endl;
@@ -106,12 +106,8 @@ BOOST_AUTO_TEST_CASE(GetTransaction) {
106106
107107 std::string txid = " 5a8f750129702d4e0ccd3e6fa91193d8191ea9742a36835b43d3b3c56ad816d1" ;
108108 gettransaction_t response;
109- try {
110- response = fx.btc .gettransaction (txid, false );
111- } catch (BitcoinException& e) {
112- BOOST_REQUIRE (e.getCode () == -5 );
113- return ;
114- }
109+
110+ NO_THROW_EXCEPT (response = fx.btc .gettransaction (txid, false ), -5 );
115111
116112 #ifdef VERBOSE
117113 std::cout << " === gettransaction ===" << std::endl;
@@ -151,7 +147,7 @@ BOOST_AUTO_TEST_CASE(ListTransactions) {
151147 MyFixture fx;
152148
153149 std::vector<transactioninfo_t > response;
154- BOOST_REQUIRE_NO_THROW (response = fx.btc .listtransactions ());
150+ NO_THROW (response = fx.btc .listtransactions ());
155151
156152 #ifdef VERBOSE
157153 std::cout << " === listtransactions ===" << std::endl;
@@ -185,14 +181,9 @@ BOOST_AUTO_TEST_CASE(GetAccount) {
185181 std::string address;
186182 std::string response;
187183
188- try {
189- address = fx.btc .getnewaddress (" TestUser" );
190- } catch (BitcoinException& e) {
191- BOOST_REQUIRE (e.getCode () == -12 );
192- BOOST_WARN_MESSAGE (false , e.getMessage ());
193- }
184+ NO_THROW_EXCEPT (address = fx.btc .getnewaddress (" TestUser" ), -12 );
194185
195- BOOST_REQUIRE_NO_THROW (response = fx.btc .getaccount (address));
186+ NO_THROW (response = fx.btc .getaccount (address));
196187 BOOST_REQUIRE (response == " TestUser" );
197188
198189 #ifdef VERBOSE
@@ -209,16 +200,10 @@ BOOST_AUTO_TEST_CASE(GetAccountAddress) {
209200 std::string response;
210201
211202 /* Unlock wallet and refill the keypool */
212- try {
213- fx.btc .walletpassphrase (" 123456" , 10 );
214- } catch (BitcoinException& e) {
215- BOOST_REQUIRE (e.getCode () == -14 );
216- BOOST_WARN_MESSAGE (false , e.getMessage ());
217- return ;
218- }
203+ NO_THROW_EXCEPT (fx.btc .walletpassphrase (" 123456" , 10 ), -14 );
219204
220- BOOST_REQUIRE_NO_THROW (fx.btc .keypoolrefill ());
221- BOOST_REQUIRE_NO_THROW (address = fx.btc .getnewaddress (" TestUser" ));
205+ NO_THROW (fx.btc .keypoolrefill ());
206+ NO_THROW (address = fx.btc .getnewaddress (" TestUser" ));
222207 BOOST_REQUIRE (address.length () >= 27 && address.length () <= 34 );
223208
224209 #ifdef VERBOSE
@@ -232,7 +217,7 @@ BOOST_AUTO_TEST_CASE(GetAddressesByAccount) {
232217 MyFixture fx;
233218
234219 std::vector<std::string> response;
235- BOOST_REQUIRE_NO_THROW (response = fx.btc .getaddressesbyaccount (" TestUser" ));
220+ NO_THROW (response = fx.btc .getaddressesbyaccount (" TestUser" ));
236221 BOOST_REQUIRE (response.size () >= 1 );
237222
238223 #ifdef VERBOSE
@@ -249,7 +234,7 @@ BOOST_AUTO_TEST_CASE(ListAccounts) {
249234 MyFixture fx;
250235
251236 std::map<std::string, double > response;
252- BOOST_REQUIRE_NO_THROW (response = fx.btc .listaccounts ());
237+ NO_THROW (response = fx.btc .listaccounts ());
253238
254239 #ifdef VERBOSE
255240 std::cout << " === listaccounts ===" << std::endl;
@@ -287,8 +272,8 @@ BOOST_AUTO_TEST_CASE(SetAccount) {
287272 MyFixture fx;
288273
289274 std::string address;
290- BOOST_REQUIRE_NO_THROW (address = fx.btc .getnewaddress (" TestUser" ))
291- BOOST_REQUIRE_NO_THROW (fx.btc .setaccount (address," TestUser2" ));
275+ NO_THROW_EXCEPT (address = fx.btc .getnewaddress (" TestUser" ), - 12 );
276+ NO_THROW (fx.btc .setaccount (address," TestUser2" ));
292277}
293278
294279BOOST_AUTO_TEST_CASE (SendToAddress) {
@@ -348,7 +333,7 @@ BOOST_AUTO_TEST_CASE(GetTxOut) {
348333 std::string txid = " 105d8fd318533d4559492b85a27039f2bf8bdfed39b8e671753289eaeb3829ae" ;
349334 utxoinfo_t response;
350335
351- BOOST_REQUIRE_NO_THROW (response = fx.btc .gettxout (txid, 0 ));
336+ NO_THROW (response = fx.btc .gettxout (txid, 0 ));
352337
353338 #ifdef VERBOSE
354339 std::cout << " === gettxout ===" << std::endl;
@@ -374,7 +359,7 @@ BOOST_AUTO_TEST_CASE(GetTxOutSetInfo) {
374359
375360 utxosetinfo_t response;
376361
377- BOOST_REQUIRE_NO_THROW (response = fx.btc .gettxoutsetinfo ());
362+ NO_THROW (response = fx.btc .gettxoutsetinfo ());
378363
379364 #ifdef VERBOSE
380365 std::cout << " === gettxoutsetinfo ===" << std::endl;
@@ -393,7 +378,7 @@ BOOST_AUTO_TEST_CASE(ListUnspent) {
393378 MyFixture fx;
394379
395380 std::vector<unspenttxout_t > response;
396- BOOST_REQUIRE_NO_THROW (response = fx.btc .listunspent ());
381+ NO_THROW (response = fx.btc .listunspent ());
397382
398383 #ifdef VERBOSE
399384 std::cout << " === listunspent ===" << std::endl;
@@ -415,7 +400,7 @@ BOOST_AUTO_TEST_CASE(ListLockUnspent) {
415400 MyFixture fx;
416401
417402 std::vector<txout_t > response;
418- BOOST_REQUIRE_NO_THROW (response = fx.btc .listlockunspent ());
403+ NO_THROW (response = fx.btc .listlockunspent ());
419404
420405 #ifdef VERBOSE
421406 std::cout << " === listlockunspent ===" << std::endl;
@@ -436,7 +421,7 @@ BOOST_AUTO_TEST_CASE(LockUnspent) {
436421 param.push_back (tmp);
437422 bool response;
438423
439- BOOST_REQUIRE_NO_THROW (response = fx.btc .lockunspent (false , param));
424+ NO_THROW (response = fx.btc .lockunspent (false , param));
440425 BOOST_REQUIRE (response == true );
441426}
442427
@@ -445,7 +430,7 @@ BOOST_AUTO_TEST_CASE(ListAddressGroupings) {
445430 MyFixture fx;
446431 std::vector< std::vector<addressgrouping_t > > response;
447432
448- BOOST_REQUIRE_NO_THROW (response = fx.btc .listaddressgroupings ());
433+ NO_THROW (response = fx.btc .listaddressgroupings ());
449434
450435 #ifdef VERBOSE
451436 std::cout << " === listaddressgroupings ===" << std::endl;
0 commit comments