changeset 372:68841f9ab96c

Added yet another test snippet
author Windel Bouwman
date Fri, 21 Mar 2014 12:33:30 +0100
parents 9c95f93f5b7a
children fc1b89b09896
files test/testemulation.py test/testsamples.py
diffstat 2 files changed, 30 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/testemulation.py	Fri Mar 21 12:01:19 2014 +0100
+++ b/test/testemulation.py	Fri Mar 21 12:33:30 2014 +0100
@@ -33,12 +33,16 @@
     qemu_serial_serve.listen(0)
 
     args = ['qemu-system-arm', '-M', machine, '-m', '16M',
-        '-nographic', '-kernel', kernel, '-monitor',
-        'unix:qemucontrol.sock',
-        '-serial', 'unix:qemuserial.sock', '-S']
+        '-nographic',
+        '-kernel', kernel,
+        '-monitor', 'unix:qemucontrol.sock',
+        '-serial', 'unix:qemuserial.sock',
+        '-S']
     p = subprocess.Popen(args)
 
-    # Give process some time to boot:
+    #qemu_serial Give process some time to boot:
+    qemu_serial_serve.settimeout(3)
+    qemu_control_serve.settimeout(3)
     qemu_serial, address_peer = qemu_serial_serve.accept()
     qemu_control, address_peer = qemu_control_serve.accept()
 
--- a/test/testsamples.py	Fri Mar 21 12:01:19 2014 +0100
+++ b/test/testsamples.py	Fri Mar 21 12:33:30 2014 +0100
@@ -42,6 +42,28 @@
         res = "".join("A = 0x{0:08X}\n".format(a) for a in range(10))
         self.do(snippet, res)
 
+    def testParameterPassing4(self):
+        snippet = """
+         module sample;
+         import io;
+         function void dump(int a, int b, int c, int d)
+         {
+            io.print2("a=", a);
+            io.print2("b=", b);
+            io.print2("c=", c);
+            io.print2("d=", d);
+         }
+         function void start()
+         {
+            dump(4,55,66,0x1337);
+         }
+        """
+        res = "a=0x{0:08X}\n".format(4)
+        res += "b=0x{0:08X}\n".format(55)
+        res += "c=0x{0:08X}\n".format(66)
+        res += "d=0x{0:08X}\n".format(0x1337)
+        self.do(snippet, res)
+
     def testGlobalVariable(self):
         snippet = """
          module sample;