From 063d21fc9a1ba57ab31269c76238b6d02d294437 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 11 Jan 2017 23:52:14 +0100 Subject: [PATCH] tests: merge log2.tst and some bugfix tests into intarith.tst --- tst/testinstall/intarith.tst | 20 ++++++++++++++++++++ tst/testinstall/log2.tst | 12 ------------ tst/teststandard/bugfix.tst | 9 --------- 3 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 tst/testinstall/log2.tst diff --git a/tst/testinstall/intarith.tst b/tst/testinstall/intarith.tst index ef7beac993..b5ce13b2f4 100644 --- a/tst/testinstall/intarith.tst +++ b/tst/testinstall/intarith.tst @@ -505,6 +505,26 @@ gap> List(data, Log2Int); [ 66, 66, 13, 0, -1, 0, 13, 66, 66 ] gap> Log2Int("abc"); Error, Log2Int: argument must be an integer (not a list (string)) +gap> List([-5..5], Log2Int); +[ 2, 2, 1, 1, 0, -1, 0, 1, 1, 2, 2 ] +gap> ForAll([2..100], x -> Log2Int(2^x) = x and +> Log2Int(2^x-1) = x-1 and +> Log2Int(2^x+1) = x); +true +gap> ForAll([2..100], x -> Log2Int(-(2^x)) = x and +> Log2Int(-(2^x)-1) = x and +> Log2Int(-(2^x)+1) = x-1); +true + +# corner cases +gap> Log2Int( 2^28 ); +28 +gap> Log2Int( -2^28 ); +28 +gap> Log2Int( 2^60 ); +60 +gap> Log2Int( -2^60 ); +60 # # string to integer conversion diff --git a/tst/testinstall/log2.tst b/tst/testinstall/log2.tst deleted file mode 100644 index c41c7e9dda..0000000000 --- a/tst/testinstall/log2.tst +++ /dev/null @@ -1,12 +0,0 @@ -gap> START_TEST("log2.tst"); -gap> List([-5..5], Log2Int); -[ 2, 2, 1, 1, 0, -1, 0, 1, 1, 2, 2 ] -gap> ForAll([2..100], x -> Log2Int(2^x) = x and -> Log2Int(2^x-1) = x-1 and -> Log2Int(2^x+1) = x); -true -gap> ForAll([2..100], x -> Log2Int(-(2^x)) = x and -> Log2Int(-(2^x)-1) = x and -> Log2Int(-(2^x)+1) = x-1); -true -gap> STOP_TEST( "log2.tst", 260000); diff --git a/tst/teststandard/bugfix.tst b/tst/teststandard/bugfix.tst index 69139c730c..1ca1f07685 100644 --- a/tst/teststandard/bugfix.tst +++ b/tst/teststandard/bugfix.tst @@ -1808,15 +1808,6 @@ true gap> (Z(65536)^2)^LogFFE(Z(65536)^16386,Z(65536)^2) = Z(65536)^16386; true -# Reported by TB on 2009/11/09, added by AK on 2011/01/20 -# Log2Int(2^60) bug (a 64bit/GMP issue) -gap> Log2Int( 2^60 ); -60 - -# Reported by Chris Jefferson on 20151008 in github issue #282 -gap> Log2Int( -2^60 ); -60 - # Reported by WDeMeo on 2011/02/19, added by JS on 2011/03/09 # IntermediateSubgroups(G,normal) included non-maximal inclusions gap> g:=CyclicGroup(2^6);; IntermediateSubgroups( g, TrivialSubgroup(g) ).inclusions;