X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Fbigint.pl;h=7f67afda86e6230fd7155a7c56601f26ff04af12;hb=691567b16c13087b31ee4c2b6d038e57872fae82;hp=4472f7588845d666fc4a91a0e92b52d02d241d7e;hpb=afaa71b3866b46b082b6c895772e15b36d8865fe;p=debian%2Famanda diff --git a/installcheck/bigint.pl b/installcheck/bigint.pl index 4472f75..7f67afd 100644 --- a/installcheck/bigint.pl +++ b/installcheck/bigint.pl @@ -1,8 +1,9 @@ -# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved. # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -13,10 +14,12 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com use Test::More tests => 74; +use strict; +use warnings; use lib "@amperldir@"; use Amanda::Tests; @@ -25,39 +28,39 @@ use Amanda::BigIntCompat; # define some constants; Perl doesn't have native 64-bit numbers, so # none are tested -$G_MAXUINT64_bigint = Math::BigInt->new('18446744073709551615'); -$G_MAXINT64_bigint = Math::BigInt->new('9223372036854775807'); -$G_MININT64_bigint = Math::BigInt->new('-9223372036854775808'); - -$G_MAXUINT32_native = 2 ** 32 - 1; -$G_MAXUINT32_double = 2.0 ** 32 - 1; -$G_MAXUINT32_bigint = Math::BigInt->new('4294967295'); -$G_MAXINT32_native = 2 ** 31 - 1; -$G_MAXINT32_double = 2.0 ** 31 - 1; -$G_MAXINT32_bigint = Math::BigInt->new('2147483647'); -$G_MININT32_native = - 2 ** 31; -$G_MININT32_double = - 2.0 ** 31; -$G_MININT32_bigint = Math::BigInt->new('-2147483648'); - -$G_MAXUINT16_native = 2 ** 16 - 1; -$G_MAXUINT16_double = 2.0 ** 16 - 1; -$G_MAXUINT16_bigint = Math::BigInt->new('65535'); -$G_MAXINT16_native = 2 ** 15 - 1; -$G_MAXINT16_double = 2.0 ** 15 - 1; -$G_MAXINT16_bigint = Math::BigInt->new('32767'); -$G_MININT16_native = - 2 ** 15; -$G_MININT16_double = - 2.0 ** 15; -$G_MININT16_bigint = Math::BigInt->new('-32768'); - -$G_MAXUINT8_native = 2 ** 8 - 1; -$G_MAXUINT8_double = 2.0 ** 8 - 1; -$G_MAXUINT8_bigint = Math::BigInt->new('255'); -$G_MAXINT8_native = 2 ** 7 - 1; -$G_MAXINT8_double = 2.0 ** 7 - 1; -$G_MAXINT8_bigint = Math::BigInt->new('127'); -$G_MININT8_native = - 2 ** 7; -$G_MININT8_double = - 2.0 ** 7; -$G_MININT8_bigint = Math::BigInt->new('-128'); +my $G_MAXUINT64_bigint = Math::BigInt->new('18446744073709551615'); +my $G_MAXINT64_bigint = Math::BigInt->new('9223372036854775807'); +my $G_MININT64_bigint = Math::BigInt->new('-9223372036854775808'); + +my $G_MAXUINT32_native = 2 ** 32 - 1; +my $G_MAXUINT32_double = 2.0 ** 32 - 1; +my $G_MAXUINT32_bigint = Math::BigInt->new('4294967295'); +my $G_MAXINT32_native = 2 ** 31 - 1; +my $G_MAXINT32_double = 2.0 ** 31 - 1; +my $G_MAXINT32_bigint = Math::BigInt->new('2147483647'); +my $G_MININT32_native = - 2 ** 31; +my $G_MININT32_double = - 2.0 ** 31; +my $G_MININT32_bigint = Math::BigInt->new('-2147483648'); + +my $G_MAXUINT16_native = 2 ** 16 - 1; +my $G_MAXUINT16_double = 2.0 ** 16 - 1; +my $G_MAXUINT16_bigint = Math::BigInt->new('65535'); +my $G_MAXINT16_native = 2 ** 15 - 1; +my $G_MAXINT16_double = 2.0 ** 15 - 1; +my $G_MAXINT16_bigint = Math::BigInt->new('32767'); +my $G_MININT16_native = - 2 ** 15; +my $G_MININT16_double = - 2.0 ** 15; +my $G_MININT16_bigint = Math::BigInt->new('-32768'); + +my $G_MAXUINT8_native = 2 ** 8 - 1; +my $G_MAXUINT8_double = 2.0 ** 8 - 1; +my $G_MAXUINT8_bigint = Math::BigInt->new('255'); +my $G_MAXINT8_native = 2 ** 7 - 1; +my $G_MAXINT8_double = 2.0 ** 7 - 1; +my $G_MAXINT8_bigint = Math::BigInt->new('127'); +my $G_MININT8_native = - 2 ** 7; +my $G_MININT8_double = - 2.0 ** 7; +my $G_MININT8_bigint = Math::BigInt->new('-128'); # first test "taking" integers -- Perl -> C