summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-17 16:12:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-17 16:12:14 (GMT)
commit3aefaf62e4de2181582277bb60fe2a4ee5c506a2 (patch)
treece84219a5932e60edc4b6d0a8b9ee60cb721f33b /tests
parenta9263ba9069329f5c9f64a6a965cfce12f18ab15 (diff)
downloadtcl-3aefaf62e4de2181582277bb60fe2a4ee5c506a2.zip
tcl-3aefaf62e4de2181582277bb60fe2a4ee5c506a2.tar.gz
tcl-3aefaf62e4de2181582277bb60fe2a4ee5c506a2.tar.bz2
Fix libtommath's mp_radix_size() function such that it returns 2 for single-digit numbers. Add testcases for mp_radix_size() and mp_iseven(). Undo useless change in bn_mp_add_d.c (bring back libtommath's version).
Diffstat (limited to 'tests')
-rw-r--r--tests/obj.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/obj.test b/tests/obj.test
index 126d5ca..f8aae59 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -623,6 +623,19 @@ test obj-33.7 {integer overflow on input} {longIs32bit wideBiggerThanInt} {
list [string is integer $x] [expr { wide($x) }]
} {0 -4294967296}
+test obj-34.1 {mp_iseven} testobj {
+ set result ""
+ lappend result [testbignumobj set 1 0]
+ lappend result [testbignumobj iseven 1] ;
+ lappend result [testobj type 1]
+} {0 1 int}
+test obj-34.2 {mp_radix_size} testobj {
+ set result ""
+ lappend result [testbignumobj set 1 9]
+ lappend result [testbignumobj radixsize 1] ;
+ lappend result [testobj type 1]
+} {9 2 int}
+
if {[testConstraint testobj]} {
testobj freeallvars
}