aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/util.sh
diff options
context:
space:
mode:
Diffstat (limited to 'qa/rpc-tests/util.sh')
-rw-r--r--qa/rpc-tests/util.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/qa/rpc-tests/util.sh b/qa/rpc-tests/util.sh
index 1e7bd6a7ee..b726ef627f 100644
--- a/qa/rpc-tests/util.sh
+++ b/qa/rpc-tests/util.sh
@@ -38,6 +38,10 @@ function AssertEqual {
if (( $( echo "$1 == $2" | bc ) == 0 ))
then
echoerr "AssertEqual: $1 != $2"
+ declare -f CleanUp > /dev/null 2>&1
+ if [[ $? -eq 0 ]] ; then
+ CleanUp
+ fi
exit 1
fi
}
@@ -49,6 +53,10 @@ function CheckBalance {
if (( $( echo "$B == $EXPECT" | bc ) == 0 ))
then
echoerr "bad balance: $B (expected $2)"
+ declare -f CleanUp > /dev/null 2>&1
+ if [[ $? -eq 0 ]] ; then
+ CleanUp
+ fi
exit 1
fi
}