[svn:parrot] r41379 - in trunk: src/pmc t/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Sep 20 14:05:49 UTC 2009


Author: bacek
Date: Sun Sep 20 14:05:48 2009
New Revision: 41379
URL: https://trac.parrot.org/parrot/changeset/41379

Log:
[core] Implement PackfileRawSegment.push_integer

Modified:
   trunk/src/pmc/packfilerawsegment.pmc
   trunk/t/pmc/packfilerawsegment.t

Modified: trunk/src/pmc/packfilerawsegment.pmc
==============================================================================
--- trunk/src/pmc/packfilerawsegment.pmc	Sun Sep 20 13:46:35 2009	(r41378)
+++ trunk/src/pmc/packfilerawsegment.pmc	Sun Sep 20 14:05:48 2009	(r41379)
@@ -175,6 +175,20 @@
 
 /*
 
+=item C<void push_integer(INTVAL value)>
+
+Append opcode to segment
+
+=cut
+
+*/
+    VTABLE void push_integer(INTVAL value)  {
+        VTABLE_push_integer(interp,
+            PARROT_PACKFILERAWSEGMENT(SELF)->opcodes, value);
+    }
+
+/*
+
 =item C<METHOD type()>
 
 Set of get segment type.

Modified: trunk/t/pmc/packfilerawsegment.t
==============================================================================
--- trunk/t/pmc/packfilerawsegment.t	Sun Sep 20 13:46:35 2009	(r41378)
+++ trunk/t/pmc/packfilerawsegment.t	Sun Sep 20 14:05:48 2009	(r41379)
@@ -25,9 +25,10 @@
 .include 'packfile_segments.pasm'
 .sub 'main' :main
 .include 'test_more.pir'
-    plan(5)
+    plan(7)
     test_elements()
     test_get_integer()
+    test_push_integer()
     test_type()
 .end
 
@@ -62,6 +63,19 @@
     ok($I0, "PackfileRawSegment.get_integer_keyed_int returns some data")
 .end
 
+# PackfileRawSegment.push_integer
+.sub 'test_push_integer'
+    .local pmc pfseg
+    pfseg = new ['PackfileRawSegment']
+
+    push pfseg, 0x1d1
+    push pfseg, 0x002
+    $I0 = pfseg[0]
+    is($I0, 0x1d1, "PackfileRawSegment.push_integer (1)")
+    $I0 = pfseg[1]
+    is($I0, 0x002, "PackfileRawSegment.push_integer (2)")
+.end
+
 # PackfileRawSegment.type
 .sub 'test_type'
     .local pmc pf, pfdir, pfseg, hash, it


More information about the parrot-commits mailing list