[svn:parrot] r49491 - trunk/t/pmc
dukeleto at svn.parrot.org
dukeleto at svn.parrot.org
Sun Oct 10 08:10:00 UTC 2010
Author: dukeleto
Date: Sun Oct 10 08:10:00 2010
New Revision: 49491
URL: https://trac.parrot.org/parrot/changeset/49491
Log:
[t] Add tests for creating TCP and UDP sockets
Modified:
trunk/t/pmc/socket.t
Modified: trunk/t/pmc/socket.t
==============================================================================
--- trunk/t/pmc/socket.t Sun Oct 10 07:57:32 2010 (r49490)
+++ trunk/t/pmc/socket.t Sun Oct 10 08:10:00 2010 (r49491)
@@ -16,14 +16,17 @@
=cut
+.include 'socket.pasm'
.sub main :main
.include 'test_more.pir'
- plan(5)
+ plan(7)
test_init()
test_clone()
test_bool()
+ test_tcp_socket()
+ test_udp_socket()
.end
@@ -51,7 +54,21 @@
$S1 = 'Socket'
$I0 = iseq $S0, $S1
todo($I0, 'Cloned PMC has correct type TT#1820')
+.end
+
+.sub test_tcp_socket
+ .local pmc sock
+ sock = new 'Socket'
+ sock.'socket'(.PIO_PF_INET, .PIO_SOCK_STREAM, .PIO_PROTO_TCP)
+ ok(sock, 'Created a TCP Socket')
+.end
+
+.sub test_udp_socket
+ .local pmc sock
+ sock = new 'Socket'
+ sock.'socket'(.PIO_PF_INET, .PIO_SOCK_STREAM, .PIO_PROTO_UDP)
+ ok(sock, 'Created a UDP Socket')
.end
# Local Variables:
More information about the parrot-commits
mailing list