gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11156: Migrated ming tests to haXe


From: Sharad Desai
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11156: Migrated ming tests to haXe for XMLSocket
Date: Fri, 19 Jun 2009 14:06:06 -0600
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11156
committer: Sharad Desai <address@hidden>
branch nick: trunk
timestamp: Fri 2009-06-19 14:06:06 -0600
message:
  Migrated ming tests to haXe for XMLSocket
modified:
  testsuite/misc-haxe.all/classes.all/net/XMLSocket_as.hx
    ------------------------------------------------------------
    revno: 11154.1.1
    committer: Sharad Desai <address@hidden>
    branch nick: desaiTst1
    timestamp: Fri 2009-06-19 14:04:55 -0600
    message:
      Migrated ming tests to haXe for XMLSocket
    modified:
      testsuite/misc-haxe.all/classes.all/net/XMLSocket_as.hx
=== modified file 'testsuite/misc-haxe.all/classes.all/net/XMLSocket_as.hx'
--- a/testsuite/misc-haxe.all/classes.all/net/XMLSocket_as.hx   2009-06-02 
02:08:31 +0000
+++ b/testsuite/misc-haxe.all/classes.all/net/XMLSocket_as.hx   2009-06-19 
20:04:55 +0000
@@ -1,4 +1,5 @@
-// XMLSocket_as.hx:  ActionScript 3 "XMLSocket" class, for Gnash.
+// XMLSocket_as.hx:  ActionScript 3 "XMLSocket" class, for Gnash. 
+// Includes all ming cases as well
 //
 // Generated by gen-as3.sh on: 20090514 by "rob". Remove this
 // after any hand editing loosing changes.
@@ -49,38 +50,242 @@
             DejaGnu.fail("XMLSocket class doesn't exist");
         }
 
-       // Tests to see if all the properties exist. All these do is test for
-       // existance of a property, and don't test the functionality at all. 
This
-       // is primarily useful only to test completeness of the API 
implementation.
-       #if flash9
-       if (Type.typeof(x1.connected)==TBool) {
-           DejaGnu.pass("XMLSocket.connected property exists");
-       } else {
-           DejaGnu.fail("XMLSocket.connected property doesn't exist");
-       }
-       #end
-
-       // Tests to see if all the methods exist. All these do is test for
-       // existance of a method, and don't test the functionality at all. This
-       // is primarily useful only to test completeness of the API 
implementation.
-       if (Type.typeof(x1.close)==TFunction) {
-           DejaGnu.pass("XMLSocket::close() method exists");
-       } else {
-           DejaGnu.fail("XMLSocket::close() method doesn't exist");
-       }
-       if (Type.typeof(x1.connect)==TFunction) {
-           DejaGnu.pass("XMLSocket::connect() method exists");
-       } else {
-           DejaGnu.fail("XMLSocket::connect() method doesn't exist");
-       }
-       if (Type.typeof(x1.send)==TFunction) {
-           DejaGnu.pass("XMLSocket::send() method exists");
-       } else {
-           DejaGnu.fail("XMLSocket::send() method doesn't exist");
-       }
-
-        // Call this after finishing all tests. It prints out the totals.
-        DejaGnu.done();
+               // Tests to see if all the properties exist. All these do is 
test for
+               // existance of a property, and don't test the functionality at 
all. This
+               // is primarily useful only to test completeness of the API 
implementation.
+               #if flash9
+               if (Type.typeof(x1.connected)==TBool) {
+                       DejaGnu.pass("XMLSocket.hasOwnProperty('connected')");
+               } else {
+                       DejaGnu.fail("XMLSocket.hasOwnProperty('connected')");
+               }
+               #end
+               
+               if (Type.typeof(x1.connect)==ValueType.TFunction) {
+                       
DejaGnu.pass("XMLSocket.prototype.hasOwnProperty('connect')");
+               } else {
+                       
DejaGnu.fail("!XMLSocket.prototype.hasOwnProperty('connect')");
+               }
+               if (Type.typeof(x1.send)==ValueType.TFunction) {
+                       
DejaGnu.pass("XMLSocket.prototype.hasOwnProperty('send')");
+               } else {
+                       
DejaGnu.fail("!XMLSocket.prototype.hasOwnProperty('send')");
+               }
+               if (Type.typeof(x1.close)==ValueType.TFunction) {
+                       
DejaGnu.pass("XMLSocket.prototype.hasOwnProperty('close')");
+               } else {
+                       
DejaGnu.fail("!XMLSocket.prototype.hasOwnProperty('close')");
+               }
+               
+               #if !flash9
+               if (Std.is(untyped XMLSocket.onData, Dynamic)) {
+                       
DejaGnu.pass("XMLSocket.prototype.hasOwnProperty('onData')");
+               } else {
+                       
DejaGnu.fail("!XMLSocket.prototype.hasOwnProperty('onData')");
+               }
+               if (!untyped XMLSocket.prototype.hasOwnProperty("onXML")) {
+                       
DejaGnu.pass("!XMLSocket.prototype.hasOwnProperty('onXML')");
+               } else {
+                       
DejaGnu.fail("XMLSocket.prototype.hasOwnProperty('onXML')");
+               }
+               if (!untyped XMLSocket.prototype.hasOwnProperty("onConnect")) {
+                       
DejaGnu.pass("!XMLSocket.prototype.hasOwnProperty('onConnect')");
+               } else {
+                       
DejaGnu.fail("XMLSocket.prototype.hasOwnProperty('onConnect')");
+               }
+               if (!untyped XMLSocket.prototype.hasOwnProperty("onClose")) {
+                       
DejaGnu.pass("!XMLSocket.prototype.hasOwnProperty('onClose')");
+               } else {
+                       
DejaGnu.fail("XMLSocket.prototype.hasOwnProperty('onClose')");
+               }
+               
+               if (Type.typeof(untyped XMLSocket) == ValueType.TFunction) {
+                       DejaGnu.pass("typeof(XMLSocket)=='function'");
+               } else {
+                       DejaGnu.fail("typeof(XMLSocket)!='function'");
+               }
+               
+               #end
+               
+               if (untyped XMLSocket.connect==null) {
+                       DejaGnu.pass("typeof(XMLSocket.connect)=='undefined'");
+               } else {
+                       DejaGnu.fail("typeof(XMLSocket.connect)!='undefined'");
+               }
+               if (untyped XMLSocket.close==null) {
+                       DejaGnu.pass("typeof(XMLSocket.close)=='undefined'");
+               } else {
+                       DejaGnu.fail("typeof(XMLSocket.close)!='undefined'");
+               }
+               if (untyped XMLSocket.send==null) {
+                       DejaGnu.pass("typeof(XMLSocket.send)=='undefined'");
+               } else {
+                       DejaGnu.fail("typeof(XMLSocket.send)!='undefined'");
+               }       
+
+               if (untyped XMLSocket.connected==null) {
+                       
DejaGnu.pass("typeof(XMLSocket.connected)=='undefined'");
+               } else {
+                       
DejaGnu.fail("typeof(XMLSocket.connected)!='undefined'");
+               }                       
+               if (untyped XMLSocket.prototype.Connected==null) {
+                       
DejaGnu.pass("typeof(XMLSocket.prototype.Connected)=='function'");
+               } else {
+                       
DejaGnu.fail("typeof(XMLSocket.prototype.Connected)!='function'");
+               }
+               if (untyped XMLSocket.prototype.connected==null) {
+                       
DejaGnu.pass("typeof(XMLSocket.prototype.connected)=='function'");
+               } else {
+                       
DejaGnu.fail("typeof(XMLSocket.prototype.connected)!='function'");
+               }
+
+               var socketObj = untyped __new__(XMLSocket);
+               
+               #if !flash9
+               if (Type.typeof(socketObj.onData)==ValueType.TFunction) {
+                       DejaGnu.pass("typeof(socketObj.onData)=='function'");
+               } else {
+                       DejaGnu.fail("typeof(socketObj.onData)!='function'");
+               }
+               if (Type.typeof(socketObj.__proto__)==ValueType.TObject) {
+                       
DejaGnu.pass("typeof(socketObj.__proto__)==XMLSocket.prototype");
+               } else {
+                       
DejaGnu.fail("typeof(socketObj.__proto__)!=XMLSocket.prototype");
+               }
+               if (Type.typeof(socketObj)==ValueType.TObject) {
+                       DejaGnu.pass("typeof(socketObj)=='object'");
+               } else {
+                       DejaGnu.fail("typeof(socketObj)!='object'");
+               }
+               
+               if (Type.typeof(untyped 
XMLSocket.prototype.connect)==ValueType.TFunction) {
+                       
DejaGnu.pass("typeof(XMLSocket.prototype.connect)=='function'");
+               } else {
+                       
DejaGnu.fail("typeof(XMLSocket.prototype.connect)!='function'");
+               }
+               if (Type.typeof(untyped 
XMLSocket.prototype.close)==ValueType.TFunction) {
+                       
DejaGnu.pass("typeof(XMLSocket.prototype.close)=='function'");
+               } else {
+                       
DejaGnu.fail("typeof(XMLSocket.prototype.close)!='function'");
+               }
+               if (Type.typeof(untyped 
XMLSocket.prototype.send)==ValueType.TFunction) {
+                       
DejaGnu.pass("typeof(XMLSocket.prototype.send)=='function'");
+               } else {
+                       
DejaGnu.fail("typeof(XMLSocket.prototype.send)!='function'");
+               }
+               
+               if (! untyped socketObj.hasOwnProperty("connect")) {
+                       DejaGnu.pass("! socketObj.hasOwnProperty('connect')");
+               } else {
+                       DejaGnu.fail("socketObj.hasOwnProperty('connect')");
+               }
+               if (! untyped socketObj.hasOwnProperty("close")) {
+                       DejaGnu.pass("! socketObj.hasOwnProperty('close')");
+               } else {
+                       DejaGnu.fail("socketObj.hasOwnProperty('close')");
+               }
+               if (! untyped socketObj.hasOwnProperty("send")) {
+                       DejaGnu.pass("! socketObj.hasOwnProperty('send')");
+               } else {
+                       DejaGnu.fail("socketObj.hasOwnProperty('send')");
+               }
+               #end
+       
+               
+               #if !flash9
+               untyped socketObj.secret = 4;
+               
+               socketObj.onConnect = function(success) {
+                       if (socketObj.secret==4) {
+                               DejaGnu.note("socketObj.secret==4");
+                       } else {
+                               DejaGnu.note("socketObj.secret!=4");
+                       }
+                       
+                       if (success) {
+                               DejaGnu.note("XMLSocket.onConnect(success) 
called");
+                       }
+                       else {
+                               DejaGnu.note("XMLSocket.onConnect(failure) 
called");
+                       }
+               };
+               
+               socketObj.onXML = function(x) {
+                       if (socketObj.secret==4) {
+                               DejaGnu.note("socketObj.secret==4");
+                       } else {
+                               DejaGnu.note("socketObj.secret!=4");
+                       }
+                       
+                       if (untyped __arguments__.length==1) {
+                               DejaGnu.note("arguments.length==1");
+                       } else {
+                               DejaGnu.note("arguments.length!=1");
+                       }
+                       
+                       if (Std.is(x, XMLSocket)) {
+                               DejaGnu.note("instanceof(x, XMLSocket)");
+                       } else {
+                               DejaGnu.note("!instanceof(x, XMLSocket)");
+                       }
+                       
+                       DejaGnu.note("XMLSocket.onXML() called with a " + 
Type.typeof(untyped __arguments__[0]) + " as arg");
+                       DejaGnu.note("Parsed XML: " + x.toString());
+               };
+               
+               socketObj.onClose = function() {
+                       if (socketObj.secret==4) {
+                               DejaGnu.note("socketObj.secret==4");
+                       } else {
+                               DejaGnu.note("socketObj.secret!=4");
+                       }
+                       
+                       DejaGnu.note("XMLSocket.onClose() called with " + 
untyped __arguments__.length);
+               };
+               
+               var host:String = "madeuphost";
+               var port:Int = 109092989;
+               
+               // This is supposed to be repeated twice...
+               if (socketObj.connect(host, port)==false) {
+                       DejaGnu.pass("socketObj.connect(host, port)==false");
+               } else {
+                       DejaGnu.fail("socketObj.connect(host, port)!=false");
+               }
+               if (socketObj.connect(host, port)==false) {
+                       DejaGnu.pass("socketObj.connect(host, port)==false");
+               } else {
+                       DejaGnu.fail("socketObj.connect(host, port)!=false");
+               }
+               
+               // Same here
+               var ret = socketObj.close();
+               
+               if (ret==null) {
+                       DejaGnu.pass("ret=='undefined'");
+               } else {
+                       DejaGnu.fail("ret!='undefined'");
+               }
+               
+               var ret = socketObj.close();
+               
+               if (ret==null) {
+                       DejaGnu.pass("ret=='undefined'");
+               } else {
+                       DejaGnu.fail("ret!='undefined'");
+               }
+               
+               var ret = socketObj.send("This won't work");
+               
+               if (ret==null) {
+                       DejaGnu.pass("ret=='undefined'");
+               } else {
+                       DejaGnu.fail("ret!='undefined'");
+               }
+               #end
+
+               // Call this after finishing all tests. It prints out the 
totals.
+               DejaGnu.done();
     }
 }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]