File: 00-system.t

package info (click to toggle)
libsession-token-perl 1.503-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 196 kB
  • sloc: ansic: 166; perl: 90; makefile: 3
file content (22 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use Session::Token;

## The point of this test is to verify some system assumptions and print
## out some diagnostic information in the test output.

use strict;

use Test::More tests => 1;


my $little_endian = pack("I!", 1) =~ /^\x01/;
my $int_size = length(pack("I!", 0));
my $long_size = length(pack("L!", 0));
my $pointer_size = length(pack("P", 0));

my $system_info = ($little_endian ? 'little' : 'big') . " endian, ILP: $int_size, $long_size, $pointer_size";
diag("System: $^O - $system_info");

ok(($int_size == 4 && $long_size == 4 && $pointer_size == 4) ||
   ($int_size == 4 && $long_size == 8 && $pointer_size == 8) ||
   ($int_size == 4 && $long_size == 4 && $pointer_size == 8),
   'only ILP32, LP64, and LLP64 are supported');