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

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Sun Oct 10 07:57:32 UTC 2010


Author: dukeleto
Date: Sun Oct 10 07:57:32 2010
New Revision: 49490
URL: https://trac.parrot.org/parrot/changeset/49490

Log:
[t] More tests for Socket PMCs, including one TODO test for cloning a Socket

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

Modified: trunk/src/pmc/socket.pmc
==============================================================================
--- trunk/src/pmc/socket.pmc	Sun Oct 10 07:27:58 2010	(r49489)
+++ trunk/src/pmc/socket.pmc	Sun Oct 10 07:57:32 2010	(r49490)
@@ -66,7 +66,7 @@
         data_struct->local      = VTABLE_clone(INTERP, old_struct->local);
         data_struct->remote     = VTABLE_clone(INTERP, old_struct->remote);
 
-        return SELF;
+        return copy;
     }
 
 /*

Modified: trunk/t/pmc/socket.t
==============================================================================
--- trunk/t/pmc/socket.t	Sun Oct 10 07:27:58 2010	(r49489)
+++ trunk/t/pmc/socket.t	Sun Oct 10 07:57:32 2010	(r49490)
@@ -19,16 +19,25 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(2)
+    plan(5)
 
     test_init()
     test_clone()
+    test_bool()
 
 .end
 
 .sub test_init
     new $P0, ['Socket']
     ok(1, 'Instantiated a Socket PMC')
+
+    $S0 = typeof $P0
+    is($S0, 'Socket', 'PMC has correct type')
+.end
+
+.sub test_bool
+    new $P0, ['Socket']
+    ok($P0, 'get_bool on Socket')
 .end
 
 .sub test_clone
@@ -38,6 +47,11 @@
     $P2 = clone $P1
     ok(1, 'Cloned a Socket PMC')
 
+    $S0 = typeof $P2
+    $S1 = 'Socket'
+    $I0 = iseq $S0, $S1
+    todo($I0, 'Cloned PMC has correct type TT#1820')
+
 .end
 
 # Local Variables:


More information about the parrot-commits mailing list