gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/avm2 r9721: get initial directory structur


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9721: get initial directory structure for test cases setup. Add new haxe test case generating script for v9.
Date: Sun, 03 May 2009 09:19:08 -0600
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 9721
committer: address@hidden
branch nick: avm2
timestamp: Sun 2009-05-03 09:19:08 -0600
message:
  get initial directory structure for test cases setup. Add new haxe test case 
generating script for v9.
added:
  testsuite/as3/classes.all/
  testsuite/as3/classes.all/DejaGnu.hx
  testsuite/as3/classes.all/accessibility/
  testsuite/as3/classes.all/data/
  testsuite/as3/classes.all/desktop/
  testsuite/as3/classes.all/display/
  testsuite/as3/classes.all/errors/
  testsuite/as3/classes.all/events/
  testsuite/as3/classes.all/external/
  testsuite/as3/classes.all/filesystem/
  testsuite/as3/classes.all/filters/
  testsuite/as3/classes.all/fl/
  testsuite/as3/classes.all/gen-as3-test.sh
  testsuite/as3/classes.all/geom/
  testsuite/as3/classes.all/html/
  testsuite/as3/classes.all/media/
  testsuite/as3/classes.all/net/
  testsuite/as3/classes.all/printing/
  testsuite/as3/classes.all/sampler/
  testsuite/as3/classes.all/security/
  testsuite/as3/classes.all/system/
  testsuite/as3/classes.all/text/
  testsuite/as3/classes.all/ui/
  testsuite/as3/classes.all/utils/
  testsuite/as3/classes.all/xml/
modified:
  libcore/asobj3/gen-as3.sh
  testsuite/misc-haxe.all/Dejagnu.hx
  testsuite/misc-haxe.all/Hello.hx
=== modified file 'libcore/asobj3/gen-as3.sh'
--- a/libcore/asobj3/gen-as3.sh 2009-05-01 22:58:47 +0000
+++ b/libcore/asobj3/gen-as3.sh 2009-05-03 15:19:08 +0000
@@ -34,14 +34,17 @@
 # Add some newlines to make sed;ing and grep'ing easier.
 namespace="`basename $PWD`"
 class=`basename $1 | sed -e "s:.html::"`
-#sed -e "s/<div/
<div/g" -e "s/<t/
<t/g" -e "s/<a /
<a /g" -e "s/&nbsp;/
&nbsp;/g" 
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Camera.html
 > tmp.html
-sed -e "s/<div/
<div/g" -e "s/<t/
<t/g" -e "s/<a /
<a /g" -e "s/&nbsp;/
&nbsp;/g" $1 > tmp.html
+#sed -e "s/<div/\n<div/g" -e "s/<t/\n<t/g" -e "s/<a /\n<a /g" -e 
"s/&nbsp;/\n&nbsp;/g" 
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Camera.html
 > tmp.html
+                        
+sed -e "s/<div/\n<div/g" -e "s/<t/\n<t/g" -e "s/<a /\n<a /g" -e 
"s/&nbsp;/\n&nbsp;/g" $1 > tmp.html
 dos2unix -q tmp.html
 
 # extract the properties from the web page
 props="`sed -e '1,/MainContent/ d' -e '/Method Detail/,$d' tmp.html | grep 
"detailHeaderName" | sed -e 's:^.*detailHeaderName">::' -e 's:<.*::' | tr -s 
'\n' ' '`"
 # extract the methods from the web page
-methods="`sed -e '1,/methodDetail/ d' -e '/(eventDetail|ExamplesSummary|Event 
Detail)/,$d' tmp.html | grep "detailHeaderName" | sed -e 
's:^.*detailHeaderName">::' -e 's:<.*::'  | tr -s '\n' ' '`"
+methods="`sed -e '1,/methodDetail/ d' -e 
'/(summaryTableTitle|propertyDetail|eventDetail|ExamplesSummary|Event)/,$d' 
tmp.html | grep "detailHeaderName" | sed -e 's:^.*detailHeaderName">::' -e 
's:<.*::'  | tr -s '\n' ' '`"
+# extract the methods from the web page
+events="`sed -e '1,/eventDetail/ d' -e '/(propertyDetail|Property Detail)/,$d' 
tmp.html | grep "detailHeaderName" | sed -e 's:^.*detailHeaderName">::' -e 
's:<.*::'  | tr -s '\n' ' '`"
 
 # ignore the package-detail files
 if test x"${class}" = x"package-detail" -o x"${class}" = x"package"; then

=== added directory 'testsuite/as3/classes.all'
=== added file 'testsuite/as3/classes.all/DejaGnu.hx'
--- a/testsuite/as3/classes.all/DejaGnu.hx      1970-01-01 00:00:00 +0000
+++ b/testsuite/as3/classes.all/DejaGnu.hx      2009-05-03 15:19:08 +0000
@@ -0,0 +1,173 @@
+// Dejagnu.hx - HAXE class for dejagnu-like testing.
+//
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+import flash.Lib;
+import flash.text.TextField;
+
+class DejaGnu {
+    static var passed = 0;
+    static var failed = 0;
+    static var xpassed = 0;
+    static var xfailed = 0;
+    static var untest = 0;
+    static var unresolve = 0;
+
+    // This is a trick to force our 'init' function
+    // to be automatically called at the start of the movie.
+    static var inithack = init();
+
+    static var tf:flash.text.TextField;
+    
+    static function init() {
+        //if(dejagnu_module_initialized == 1) return;
+        
+        // create a textfield to output to
+       tf = new flash.text.TextField();
+       tf.autoSize = flash.text.TextFieldAutoSize.LEFT;
+        //flash.Lib.current.createTextField("textout", 99, 10, 10, 500, 500);
+       flash.Lib.current.addChild(tf);
+
+        //dejagnu_module_initialized = 1;
+
+       return null;
+    }
+
+    static public function fail (why) {
+        failed++;
+        var msg = 'FAILED: '+why;
+        xtrace(msg);
+    }
+
+    static public function xfail(why) {
+        xfailed++;
+        var msg = 'XFAILED: '+why;
+        xtrace(msg);
+    }
+
+    static public function pass(why) {
+        passed++;
+        var msg = 'PASSED: '+why;
+        flash.Lib.trace(msg);
+    }
+
+    static public function xpass(why) {
+        xpassed++;
+        var msg = 'XPASSED: '+why;
+        flash.Lib.trace(msg);
+    }
+    
+    static function testcount() {
+        var c = 0;
+        if ( passed > 0 ) c += passed;
+        if ( failed > 0 ) c += failed;
+        if ( xpassed > 0 ) c += xpassed;
+        if ( xfailed > 0 ) c += xfailed;
+        return c;
+    }
+
+    static function printtotals() {
+        xtrace('#passed: '+ passed);
+        xtrace('#failed: '+ failed);
+        if ( xpassed > 0 ) {
+            xtrace('#unexpected successes: '+ xpassed);
+        }
+        if ( xfailed > 0 ) {
+            xtrace('#expected failures: '+ xfailed);
+        }
+               xtrace('#total tests run: '+ testcount());
+    }
+
+    static public function totals(exp:Dynamic, msg:Dynamic) {
+        var obt = testcount();
+        if ( exp != null && obt != exp ) {
+            fail('Test run '+obt+' (expected '+exp+') '+msg);
+        } else {
+            pass('Test run '+obt+' '+msg);
+        }
+    }
+
+    static function publicxtotals(exp:Dynamic, msg:Dynamic) {
+        var obt = testcount();
+        if ( exp != null && obt != exp ) {
+            xfail('Test run '+obt+' (expected '+exp+') ['+msg+']');
+        } else {
+            xpass('Test run '+obt+' ['+msg+']');
+        }
+    }
+    
+    static public function check_equals(obt:Dynamic, exp:Dynamic, msg) {
+        if(msg == null) msg = "";
+        if ( obt == exp ) 
+            pass(obt+' == '+exp+' '+msg);
+        else 
+            fail('expected: "'+exp+'" , obtained: "'+obt+'" '+msg);
+    }
+    
+    static public function xcheck_equals(obt:Dynamic, exp:Dynamic, msg) {
+        if(msg == null) msg = "";
+        if ( obt == exp ) {
+            xpass(obt+' == '+exp+' '+msg);
+        } else {
+            xfail('expected: '+exp+' , obtained: '+obt+" "+msg);
+        }
+    }
+    
+    static public function check(a : Dynamic, msg) {
+        if ( a ) {
+            if ( msg != null ) pass(msg);
+            else pass(a);
+        } else {
+            if ( msg != null ) fail(msg);
+            else fail(a);
+        }
+    }
+
+    static public function xcheck(a : Dynamic, msg) {
+        if ( a ) {
+            if ( msg != null ) xpass(msg);
+            else xpass(a);
+        } else {
+            if ( msg != null ) xfail(msg);
+            else xfail(a);
+        }
+    }
+    
+    static public function note(msg) {
+        xtrace(msg);
+    }
+    
+    static function xtrace(msg) {
+        tf.text += msg + "\n";
+        flash.Lib.trace(msg);
+    }
+
+    static function untested(msg) {
+        flash.Lib.trace("UNTESTED: "+msg);
+    }
+
+    static function unresolved(msg) {
+        flash.Lib.trace("UNRESOLVED: "+msg);
+    }
+    
+    static public function done() {
+        printtotals();
+       flash.Lib.trace("__END_OF_TEST__");
+       //loadMovie('fscommand:quit', _root);
+    }
+}

=== added directory 'testsuite/as3/classes.all/accessibility'
=== added directory 'testsuite/as3/classes.all/data'
=== added directory 'testsuite/as3/classes.all/desktop'
=== added directory 'testsuite/as3/classes.all/display'
=== added directory 'testsuite/as3/classes.all/errors'
=== added directory 'testsuite/as3/classes.all/events'
=== added directory 'testsuite/as3/classes.all/external'
=== added directory 'testsuite/as3/classes.all/filesystem'
=== added directory 'testsuite/as3/classes.all/filters'
=== added directory 'testsuite/as3/classes.all/fl'
=== added file 'testsuite/as3/classes.all/gen-as3-test.sh'
--- a/testsuite/as3/classes.all/gen-as3-test.sh 1970-01-01 00:00:00 +0000
+++ b/testsuite/as3/classes.all/gen-as3-test.sh 2009-05-03 15:19:08 +0000
@@ -0,0 +1,222 @@
+#!/bin/sh
+#
+#   Copyright (C) 2009 Free Software Foundation, Inc.
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+# This script generates header file and C++ source file templates
+# for an ActionScript class. It depends on the doc/C/NOTES file for
+# data. It takes a single argument, which is the name of the class,
+# like "./gen-files.sh Camera".
+#
+# This script is only of use to developers, so it's "as is". Your
+# mileage may vary.
+
+if test x"$1" = "x"; then
+    echo "Usage: $0 <classname>" >&2
+    exit 1
+fi
+
+# Top level path
+# Add some newlines to make sed;ing and greping easier.
+nspace="`basename $PWD`"
+class="`basename $1 | sed -e 's:.html::'`"
+sed -e "s/<tr/\n<tr/g" $1 > tmp.html
+dos2unix -q tmp.html
+# extract the properties from the web page
+rm props.tmp
+grep -v "hideInheritedProperty" tmp.html | sed -e '/th colspan=.*Property/,/th 
colspan=.*Method/w props.tmp' > /dev/null
+properties="`grep signatureLink props.tmp | sed -e 's:<div 
class="summaryTableDescription.*::' -e 's:^.*signatureLink\">::' -e 
's:<.*\">:_:' -e 's:<.*::'`"
+
+# extract the methods from the web page
+rm methods.tmp
+grep -v "hideInheritedMethod" tmp.html | sed -e '/th colspan=.*Method/,/th 
colspan=.*Event/w methods.tmp' > /dev/null
+allmethods="`grep signatureLink methods.tmp | sed  -e 's:<div 
class="summaryTableDescription.*::' -e 's:^.*signatureLink\">::' -e 
's:<.*\">:_:' -e 's:<.*::'`"
+                        
+# extract the methods from the web page
+# events="`sed -e '1,/eventDetail/ d' -e '/(propertyDetail|Property 
Detail)/,$d' tmp.html | grep "detailHeaderName" | sed -e 
's:^.*detailHeaderName">::' -e 's:<.*::'  | tr -s '\n' ' '`"
+
+# ignore the package-detail files
+if test x"${class}" = x"package-detail" -o x"${class}" = x"package"; then
+  exit
+fi
+
+#
+# split up the list of data in pairs into an array so we can have a crude
+# association between the porterty and the data type it returns.
+#
+i=0
+for item in $properties; do
+  name="`echo $item | cut -d '_' -f 1`"
+  type="`echo $item | cut -d '_' -f 2`"
+  pargs[$i]="$type"
+  props[$i]="$name"
+  i=`eval expr $i + 1`
+done
+        
+# display what we found
+echo "Class: $class"
+i=0
+props_blanks=`echo $props | tr -d ' '`
+echo -n "    Properties: "
+if test  x"$props_blanks" != x; then
+  for item in $properties; do
+    echo -n " \"${props[$i]}\" \"${pargs[$i]}\","
+    i=`eval expr $i + 1`
+  done
+else
+  echo "none"  
+fi
+echo ""
+
+#
+# split up the list of data in pairs into an array so we can have a crude
+# association between the porterty and the data type it returns.
+#
+i=0
+for item in $allmethods; do
+  name="`echo $item | cut -d '_' -f 1`"
+  type="`echo $item | cut -d '_' -f 2`"
+  margs[$i]="$type"
+  methods[$i]="$name"
+  i=`eval expr $i + 1`
+done
+
+# display what we found
+i=0
+meth_blanks=`echo $allmethods | tr -d ' '`
+echo -n "    Methods: "
+if test  x"$meth_blanks" != x; then
+  for item in $allmethods; do
+    echo -n " \"${methods[$i]}\" \"${margs[$i]}\","
+    i=`eval expr $i + 1`
+  done
+else
+  echo "none"  
+fi
+echo ""
+
+#
+# We're done making lists of things, do some real work.
+#
+asname=${class}
+lowname=`echo ${asname} | tr '[A-Z]' '[a-z]'`
+upname=`echo ${asname}  | tr '[a-z]' '[A-Z]'`
+outname=${asname}_as3.hx
+
+if test -f ${outname}; then
+    echo ${outname} exists!
+    mv -f ${outname} ${outname}.orig
+#    exit 1;
+fi
+
+###############################################################
+# Start by generating the header file for this class
+#
+now=`date "+%Y%m%d"`
+rm -f ${outname}
+cat <<EOF>${outname}
+// ${outname}:  ActionScript 3 "${asname}" class, for Gnash.
+//
+// Generated by gen-as3.sh on: ${now} by "${USER}". Remove this
+// after any hand editing loosing changes.
+//
+//   Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#include "DejaGnu.hx"
+
+import flash.${nspace}.${asname};
+import flash.display.MovieClip;
+import flash.Lib;
+import Type;
+
+// Class must be named with the PP prefix, as that's the name the
+// file passed to haxe will have after the preprocessing step
+class PP_${asname} {
+    static function main() {
+        var x1:${asname} = new ${asname}();
+        
+        if (x1 != null) {
+            DejaGnu.pass("${asname} class exists");
+        } else {
+            DejaGnu.fail("${asname} lass doesn't exist");
+        }
+EOF
+
+# Add teste to see if all the properties exist
+i=0
+j=0
+if test  x"$props_blanks" != x; then
+    for item in $properties; do
+       name=${props[$i]}
+       type=${pargs[$i]}
+       case "${type}" in
+           "Number") result=0 ;;
+           "int") result=0 ;;
+           "String") result="null" ;;
+           "Boolean") result=false ;;
+           "Array") result=0 ;;
+           *) result=${type} ;;
+       esac
+       echo "PROPS[$i]: ${name} : ${type}"
+       lines[$j]="     if (x1.${name} == $result) {"
+       j=`eval expr $j + 1`
+       lines[$j]="         DejaGnu.pass(\"${asname}::${name} property 
exists\");"
+       j=`eval expr $j + 1`
+       lines[$j]="     } else {"
+       j=`eval expr $j + 1`
+       lines[$j]="         DejaGnu.fail(\"${asname}::${name} property doesn't 
exist\");"
+       j=`eval expr $j + 1`
+       lines[$j]="     }"
+       j=`eval expr $j + 1`
+       lines[$j]=""
+       i=`eval expr $i + 1`
+    done
+else
+    echo "none"        
+fi
+
+k=0
+while test $k -le $j; do
+    echo "${lines[$k]}" >> ${outname}
+    k=`eval expr $k + 1`
+done
+
+cat <<EOF>>${outname}
+        // Call this after finishing all tests. It prints out the totals.
+        DejaGnu.done();
+    }
+}
+EOF
+
+# cleanup after ourselves
+rm -f tmp.html
+rm -f *.tmp

=== added directory 'testsuite/as3/classes.all/geom'
=== added directory 'testsuite/as3/classes.all/html'
=== added directory 'testsuite/as3/classes.all/media'
=== added directory 'testsuite/as3/classes.all/net'
=== added directory 'testsuite/as3/classes.all/printing'
=== added directory 'testsuite/as3/classes.all/sampler'
=== added directory 'testsuite/as3/classes.all/security'
=== added directory 'testsuite/as3/classes.all/system'
=== added directory 'testsuite/as3/classes.all/text'
=== added directory 'testsuite/as3/classes.all/ui'
=== added directory 'testsuite/as3/classes.all/utils'
=== added directory 'testsuite/as3/classes.all/xml'
=== modified file 'testsuite/misc-haxe.all/Dejagnu.hx'
--- a/testsuite/misc-haxe.all/Dejagnu.hx        2009-02-25 22:33:03 +0000
+++ b/testsuite/misc-haxe.all/Dejagnu.hx        2009-05-03 15:19:08 +0000
@@ -1,6 +1,6 @@
 // Dejagnu.as - HAXE class for dejagnu-like testing.
 //
-//   Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+//   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -16,12 +16,11 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
-//
 
 import flash.Lib;
 import flash.text.TextField;
 
-class Dejagnu {
+class DejaGnu {
     static var passed = 0;
     static var failed = 0;
     static var xpassed = 0;
@@ -34,10 +33,10 @@
     static var inithack = init();
 
     static var tf:flash.text.TextField;
-
+    
     static function init() {
         //if(dejagnu_module_initialized == 1) return;
-
+        
         // create a textfield to output to
        tf = new flash.text.TextField();
        tf.autoSize = flash.text.TextFieldAutoSize.LEFT;
@@ -49,30 +48,30 @@
        return null;
     }
 
-    static function fail (why) {
+    static public function fail (why) {
         failed++;
         var msg = 'FAILED: '+why;
         xtrace(msg);
     }
 
-    static function xfail(why) {
+    static public function xfail(why) {
         xfailed++;
         var msg = 'XFAILED: '+why;
         xtrace(msg);
     }
 
-    static function pass(why) {
+    static public function pass(why) {
         passed++;
         var msg = 'PASSED: '+why;
         flash.Lib.trace(msg);
     }
 
-    static function xpass(why) {
+    static public function xpass(why) {
         xpassed++;
         var msg = 'XPASSED: '+why;
         flash.Lib.trace(msg);
     }
-
+    
     static function testcount() {
         var c = 0;
         if ( passed > 0 ) c += passed;
@@ -103,7 +102,7 @@
         }
     }
 
-    static function xtotals(exp:Dynamic, msg:Dynamic) {
+    static function publicxtotals(exp:Dynamic, msg:Dynamic) {
         var obt = testcount();
         if ( exp != null && obt != exp ) {
             xfail('Test run '+obt+' (expected '+exp+') ['+msg+']');
@@ -111,7 +110,7 @@
             xpass('Test run '+obt+' ['+msg+']');
         }
     }
-
+    
     static public function check_equals(obt:Dynamic, exp:Dynamic, msg) {
         if(msg == null) msg = "";
         if ( obt == exp ) 
@@ -119,52 +118,40 @@
         else 
             fail('expected: "'+exp+'" , obtained: "'+obt+'" '+msg);
     }
-
-       static public function xcheck_equals(obt:Dynamic, exp:Dynamic, msg)
-       {
-               if(msg == null) msg = "";
-               if ( obt == exp ) 
-               {
-                       xpass(obt+' == '+exp+' '+msg);
-               }
-               else 
-               {
-                       xfail('expected: '+exp+' , obtained: '+obt+" "+msg);
-               }
-       }
-
-       static public function check(a : Dynamic, msg)
-       {
-               if ( a ) 
-               {
-                       if ( msg != null ) pass(msg);
-                       else pass(a);
-               }
-               else 
-               {
-                       if ( msg != null ) fail(msg);
-                       else fail(a);
-               }
-       }
-
-       static public function xcheck(a : Dynamic, msg)
-       {
-               if ( a ) 
-               {
-                       if ( msg != null ) xpass(msg);
-                       else xpass(a);
-               }
-               else 
-               {
-                       if ( msg != null ) xfail(msg);
-                       else xfail(a);
-               }
-       }
-
+    
+    static public function xcheck_equals(obt:Dynamic, exp:Dynamic, msg) {
+        if(msg == null) msg = "";
+        if ( obt == exp ) {
+            xpass(obt+' == '+exp+' '+msg);
+        } else {
+            xfail('expected: '+exp+' , obtained: '+obt+" "+msg);
+        }
+    }
+    
+    static public function check(a : Dynamic, msg) {
+        if ( a ) {
+            if ( msg != null ) pass(msg);
+            else pass(a);
+        } else {
+            if ( msg != null ) fail(msg);
+            else fail(a);
+        }
+    }
+
+    static public function xcheck(a : Dynamic, msg) {
+        if ( a ) {
+            if ( msg != null ) xpass(msg);
+            else xpass(a);
+        } else {
+            if ( msg != null ) xfail(msg);
+            else xfail(a);
+        }
+    }
+    
     static public function note(msg) {
         xtrace(msg);
     }
-
+    
     static function xtrace(msg) {
         tf.text += msg + "\n";
         flash.Lib.trace(msg);
@@ -177,11 +164,10 @@
     static function unresolved(msg) {
         flash.Lib.trace("UNRESOLVED: "+msg);
     }
-
+    
     static public function done() {
         printtotals();
        flash.Lib.trace("__END_OF_TEST__");
        //loadMovie('fscommand:quit', _root);
     }
-
 }

=== modified file 'testsuite/misc-haxe.all/Hello.hx'
--- a/testsuite/misc-haxe.all/Hello.hx  2008-08-04 13:27:32 +0000
+++ b/testsuite/misc-haxe.all/Hello.hx  2009-05-03 15:19:08 +0000
@@ -1,28 +1,88 @@
-#include "check.as"
+//#include "DejaGnu.hx"
+
+import flash.media.Sound;
+import flash.display.MovieClip;
+import flash.Lib;
+import Type;
 
 // Class must be named with the PP prefix, as that's the name the
 // file passed to haxe will have after the preprocessing step
 class PP_Hello {
-       static function main()
-       {
-
-               var a = 1;
-
-               // This is how you call check_equals
-               check_equals(a, 1);
-
-               // This is how you call check
-               check(true);
-               check(!false);
-
-               // This is how you print notes (trace + visual trace)
-               note("Hello world");
-
-                // Check number of tests run (for consistency)
-               check_totals(3);
-
-                // Call this after finishing all tests. It prints out the 
totals.
-                Dejagnu.done();
-
-       }
+    static function main() {
+//         var camera : Camera = Camera.getCamera();
+        var s1:Sound = new Sound();
+        var s2:Sound = new Sound();
+        
+//          DejaGnu.note("ME "   + Type.typeof(s1.id3));
+//          DejaGnu.note("OVER " + Std.is(s1.url,TNull));
+    
+        if (s1 != null) {
+            DejaGnu.pass("Sound class exists");
+        } else {
+            DejaGnu.fail("Sound class doesn't exist");
+        }
+
+        if (s1.bytesLoaded == 0) {
+            DejaGnu.pass("Sound::bytesLoaded property exists");
+        } else {
+            DejaGnu.fail("Sound::bytesLoaded property doesn't exist, is " + 
s1.bytesLoaded);
+        }
+        
+        if (s1.bytesTotal == 0) {
+            DejaGnu.pass("Sound::bytesTotal property exists");
+        } else {
+            DejaGnu.fail("Sound::bytesTotal property doesn't exist, is " + 
s1.bytesTotal);
+        }
+
+        if (s1.isBuffering == false) {
+            DejaGnu.pass("Sound::isBuffering property exists");
+        } else {
+            DejaGnu.fail("Sound::isBuffering property doesn't exist, is " + 
s1.isBuffering);
+        }
+        
+//         if (Std.is(s1.id3,ValueType.TClass)) {
+//             DejaGnu.pass("Sound::id3 property exists");
+//         } else {
+//             DejaGnu.fail("Sound::id3 property doesn't exist");
+//         }
+        
+        if (s1.length == 0) {
+            DejaGnu.pass("Sound::length property exists, is ");
+        } else {
+            DejaGnu.fail("Sound::length property doesn't exist, is " + 
s1.length);
+        }
+        
+        if (s1.url == null) {
+            DejaGnu.pass("Sound::url property exists");
+        } else {
+            DejaGnu.fail("Sound::url property doesn't exist, is " + s1.url);
+        }
+    
+        if (s1.close != null) {
+            DejaGnu.pass("Sound::close() method exists");
+        } else {
+            DejaGnu.fail("Sound::close() method doesn't exist, is " + 
s1.close);
+        }
+    
+        if (s1.load != null) {
+            DejaGnu.pass("Sound::load() method exists");
+        } else {
+            DejaGnu.fail("Sound::load() method doesn't exist, is " + s1.load);
+        }
+        
+        if (s1.play != null) {
+            DejaGnu.pass("Sound::play() method exists");
+        } else {
+            DejaGnu.fail("Sound::(play) method doesn't exist, is " + s1.play);
+        }
+        
+        var a = 1;
+        // This is how you print notes (trace + visual trace)
+        DejaGnu.note("Hello world");
+
+        DejaGnu.pass("Something worked...");
+
+        // 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]