Author: bernhard
Date: Tue Nov 11 06:43:05 2008
New Revision: 32539

Modified:
   trunk/t/op/sysinfo.t

Log:
[t] Add PIR tests for sysinfo


Modified: trunk/t/op/sysinfo.t
==============================================================================
--- trunk/t/op/sysinfo.t        (original)
+++ trunk/t/op/sysinfo.t        Tue Nov 11 06:43:05 2008
@@ -11,7 +11,7 @@
 use Test::More;
 use Config;
 
-use Parrot::Test tests => 9;
+use Parrot::Test tests => 14;
 use Parrot::Config;
 
 
@@ -51,29 +51,35 @@
 
 =cut
 
+
 my @setup = (
     { pconfig_key => 'intvalsize',
       pasm_key    => 1,
+      pir_key     => 'SYSINFO_PARROT_INTSIZE', 
       desc        => 'integer size',
       reg_type    => 'I',
     },
     { pconfig_key => 'doublesize',
       pasm_key    => 2,
+      pir_key     => 'SYSINFO_PARROT_FLOATSIZE',       
       desc        => 'float size',
       reg_type    => 'I',
     },
     { pconfig_key => 'ptrsize',
       pasm_key    => 3,
+      pir_key     => 'SYSINFO_PARROT_POINTERSIZE',     
       desc        => 'pointer size',
       reg_type    => 'I',
     },
     { pconfig_key => 'osname',
       pasm_key    => 4,
+      pir_key     => 'SYSINFO_PARROT_OS',      
       desc        => 'osname',
       reg_type    => 'S',
     },
     { pconfig_key => 'cpuarch',
       pasm_key    => 7,
+      pir_key     => 'SYSINFO_CPU_ARCH',       
       desc        => 'CPU Arch Family',
       reg_type    => 'S',
     },
@@ -81,11 +87,18 @@
 
 foreach ( @setup ) {
     if ( $_->{reg_type} eq 'I' ) {
-        pasm_output_is( <<"CODE", $PConfig{$_->{pconfig_key}}, "sysinfo 
$_->{desc}" );
+        pasm_output_is( <<"CODE", $PConfig{$_->{pconfig_key}}, "PASM sysinfo  
$_->{desc}" );
    sysinfo_i_ic I1, $_->{pasm_key}
    print I1
 end
 CODE
+        pir_output_is( <<"CODE", $PConfig{$_->{pconfig_key}}, "PIR sysinfo  
$_->{desc}" );
+.include 'sysinfo.pasm'
+.sub main :main
+    \$I0 = sysinfo .$_->{pir_key}
+    print \$I0
+.end
+CODE
     }
     else {
         pasm_output_is( <<"CODE", $PConfig{$_->{pconfig_key}}, "sysinfo 
$_->{desc}" );
@@ -93,6 +106,13 @@
    print S1
 end
 CODE
+        pir_output_is( <<"CODE", $PConfig{$_->{pconfig_key}}, "PIR sysinfo  
$_->{desc}" );
+.include 'sysinfo.pasm'
+.sub main :main
+    \$S0 = sysinfo .$_->{pir_key}
+    print \$S0
+.end
+CODE
     }
 }
 

Reply via email to