X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Fbigint.pl;h=6fa8a3561311fa6cf6e1da2e2a173f718b8582b3;hb=cb38d19aa8dc2c5d380ab2d7ad9724a5d99eee5d;hp=4472f7588845d666fc4a91a0e92b52d02d241d7e;hpb=afaa71b3866b46b082b6c895772e15b36d8865fe;p=debian%2Famanda diff --git a/installcheck/bigint.pl b/installcheck/bigint.pl index 4472f75..6fa8a35 100644 --- a/installcheck/bigint.pl +++ b/installcheck/bigint.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2008, 2010 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 @@ -13,10 +13,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 +27,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