test23 387 B

123456789101112131415161718192021
  1. #!/usr/bin/perl
  2. #
  3. use strict;
  4. use warnings;
  5. use lib "..";
  6. use Tpl;
  7. # this test only works on 64-bit Perl
  8. my ($i,$j) = (-4294967296,4294967296); # 2^32 (can't fit in a 32-bit value)
  9. my $tpl = Tpl->tpl_map("IU",\$i,\$j);
  10. $tpl->tpl_pack(0);
  11. my $img = $tpl->tpl_dump();
  12. my ($x,$y);
  13. my $tpl2 = Tpl->tpl_map("IU",\$x,\$y);
  14. $tpl2->tpl_load(\$img);
  15. $tpl2->tpl_unpack(0);
  16. print "$x $y\n";