Skip to content

Commit 54a0437

Browse files
author
minium
committed
Increased test verbosity for debugging
1 parent 90b733a commit 54a0437

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

src/test/accounting.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(GetTransaction) {
109109
try {
110110
response = fx.btc.gettransaction(txid, false);
111111
} catch (BitcoinException& e) {
112-
BOOST_REQUIRE(e.getCode() == -5);
112+
BOOST_REQUIRE_MESSAGE(e.getCode() == -5, "Error(" << e.getCode() << "): " << e.getMessage());
113113
return;
114114
}
115115

@@ -374,7 +374,11 @@ BOOST_AUTO_TEST_CASE(GetTxOutSetInfo) {
374374

375375
utxosetinfo_t response;
376376

377-
BOOST_REQUIRE_NO_THROW(response = fx.btc.gettxoutsetinfo());
377+
try {
378+
response = fx.btc.gettxoutsetinfo();
379+
} catch (BitcoinException& e) {
380+
BOOST_REQUIRE_MESSAGE(false, "Error(" << e.getCode() << "): " << e.getMessage());
381+
}
378382

379383
#ifdef VERBOSE
380384
std::cout << "=== gettxoutsetinfo ===" << std::endl;

src/test/node.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ BOOST_AUTO_TEST_CASE(GetAddedNodeInfo) {
3333
MyFixture fx;
3434

3535
std::vector<nodeinfo_t> response;
36-
BOOST_REQUIRE_NO_THROW(response = fx.btc.getaddednodeinfo(true, "127.0.0.255"));
36+
try {
37+
response = fx.btc.getaddednodeinfo(true, "127.0.0.255");
38+
} catch (BitcoinException& e) {
39+
BOOST_REQUIRE_MESSAGE(false, "Error(" << e.getCode() << "): " << e.getMessage());
40+
}
3741

3842
#ifdef VERBOSE
3943
std::cout << "=== getaddednodeinfo ===" << std::endl;

src/test/rawtransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE(SendRawTransaction) {
135135
try{
136136
fx.btc.sendrawtransaction(txid, false);
137137
}catch(BitcoinException& e){
138-
BOOST_REQUIRE(e.getCode() == -25 || e.getCode() == -27);
138+
BOOST_REQUIRE_MESSAGE(e.getCode() == -25 || e.getCode() == -27, "Error(" << e.getCode() << "): " << e.getMessage());
139139
}
140140
}
141141

src/test/wallet.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ BOOST_AUTO_TEST_CASE(EncryptWallet) {
4444
try {
4545
fx.btc.encryptwallet("123456");
4646
} catch (BitcoinException& e) {
47-
BOOST_REQUIRE(e.getCode() == -15);
48-
BOOST_WARN_MESSAGE(false, e.getMessage());
47+
BOOST_REQUIRE_MESSAGE(false, "Error(" << e.getCode() << "): " << e.getMessage());
4948
}
5049

5150
}
@@ -235,7 +234,12 @@ BOOST_AUTO_TEST_CASE(SetTxFee) {
235234
bool response;
236235
double getinfofee;
237236

238-
BOOST_REQUIRE_NO_THROW(response = fx.btc.settxfee(0.0002));
237+
try {
238+
response = fx.btc.settxfee(0.0002);
239+
} catch (BitcoinException& e) {
240+
BOOST_REQUIRE_MESSAGE(false, "Error(" << e.getCode() << "): " << e.getMessage());
241+
}
242+
239243
BOOST_REQUIRE(response == true);
240244

241245
BOOST_REQUIRE_NO_THROW(getinfofee = fx.btc.getinfo().paytxfee);

0 commit comments

Comments
 (0)