aboutsummaryrefslogtreecommitdiff
path: root/src/test/Makefile.am
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2014-04-22 00:11:39 -0400
committerCory Fields <cory-nospam-@coryfields.com>2014-04-22 00:43:31 -0400
commitb1fdd5475d9040445d7655730f262f214ea87c5f (patch)
treee9d1993ca41fa52617656ffa42b9a0cbd5a1c0de /src/test/Makefile.am
parent90320d67779be5c97061380c035d3fe51b7ce74b (diff)
downloadbitcoin-b1fdd5475d9040445d7655730f262f214ea87c5f.tar.xz
script: Add test for CScriptNum
Because this class replaces some usages of CBigNum, tests have been added to verify that they function the same way. The only difference in their usage is the handling of out-of-range numbers. While operands are constrained to [-0x7FFFFFFF,0x7FFFFFFF], the results may overflow. The overflowing result is technically unbounded, but in practice it can be no bigger than the result of an operation on two operands. This implementation limits them to the size of an int64. CBigNum was unaware of this constraint, so it allowed for unbounded results, which were then checked before use. CScriptNum asserts if an arithmetic operation will overflow an int64_t, since scripts are not able to reach those numbers anyway. Additionally, CScriptNum will throw an exception when constructed from a vector containing more than 4 bytes This mimics the previous CastToBigNum behavior.
Diffstat (limited to 'src/test/Makefile.am')
-rw-r--r--src/test/Makefile.am1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index b375ba1306..e12f4904f1 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -61,6 +61,7 @@ test_bitcoin_SOURCES = \
transaction_tests.cpp \
uint256_tests.cpp \
util_tests.cpp \
+ scriptnum_tests.cpp \
sighash_tests.cpp \
$(JSON_TEST_FILES) $(RAW_TEST_FILES)