summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-17 16:26:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-11-17 16:26:50 (GMT)
commitd31be24ebfb55014fd29140d4406c8a840845763 (patch)
tree8745c9b69988bfd839bd9d090d41713bd840c002 /tests
parent3dd86e6ebc0137c3a2c02d3a046de046571e3789 (diff)
parent205419d4b7c3801fe37ae41bceba18fc3b230308 (diff)
downloadtcl-d31be24ebfb55014fd29140d4406c8a840845763.zip
tcl-d31be24ebfb55014fd29140d4406c8a840845763.tar.gz
tcl-d31be24ebfb55014fd29140d4406c8a840845763.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 a8d2d20..833c906 100644
--- a/tests/obj.test
+++ b/tests/obj.test
@@ -625,6 +625,19 @@ test obj-33.7 {integer overflow on input} {
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
}