Author: ben
Date: 2007-07-01 19:49:41 -0700 (Sun, 01 Jul 2007)
New Revision: 5567

Modified:
   openlaszlo/branches/legals/test/smoke/data.lzl
   openlaszlo/branches/legals/test/smoke/lzunit-test.lzl
   openlaszlo/branches/legals/test/smoke/simple.lzx
   openlaszlo/branches/legals/test/smoke/smokecheck.lzx
Log:
Change 20070628-ben-n by [EMAIL PROTECTED] on 2007-06-28 16:08:38 PDT
    in /Users/ben/src/svn/openlaszlo/branches/legals
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Explain expected errors in smokecheck debug output

New Features:

Bugs Fixed: LPP-4184  test/smoke/smokecheck.lzx reports success, but log 
contains errors

Technical Reviewer: ptw 
QA Reviewer: mkratt (pending)
Doc Reviewer: (pending)

Documentation:
The expected errors in the smokecheck used to just print red ERROR output. 
This changeset adds informative output for each expected error. 
Make IntentionalFailures match IntentionalErrors and add some 
more explanation as to why some 'expected' errors don't show up
The smokecheck currently passes in both swf8 and dhtml. 

Release Notes:

Details:
    

Tests:
http://localhost:8080/legals/test/smoke/smokecheck.lzx?lzr=swf8&debug=true 
(passes)
http://localhost:8080/legals/test/smoke/smokecheck.lzx?lzr=dhtml&debug=true 
(fails)



Modified: openlaszlo/branches/legals/test/smoke/data.lzl
===================================================================
--- openlaszlo/branches/legals/test/smoke/data.lzl      2007-07-01 06:43:36 UTC 
(rev 5566)
+++ openlaszlo/branches/legals/test/smoke/data.lzl      2007-07-02 02:49:41 UTC 
(rev 5567)
@@ -1,6 +1,6 @@
 <library>  
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 
@@ -20,11 +20,11 @@
     <view name="lor" datapath="http2:/root/child"/>
 
     <method name="testEmpty">
-      Debug.write("expect:  couldn't find dataset for http:/root");
+      Debug.info("expect:  couldn't find dataset for http:/root (error will 
print at beginning of debugger output)");
       assertEquals(0,0,0);
     </method>
     <method name="testEmpty2">
-      Debug.write("expect:  couldn't find dataset for http2:/root/child");
+      Debug.info("expect:  couldn't find dataset for http2:/root/child (error 
will print at beginning of debugger output)");
       assertEquals(0,0,0);
     </method>
   </class>

Modified: openlaszlo/branches/legals/test/smoke/lzunit-test.lzl
===================================================================
--- openlaszlo/branches/legals/test/smoke/lzunit-test.lzl       2007-07-01 
06:43:36 UTC (rev 5566)
+++ openlaszlo/branches/legals/test/smoke/lzunit-test.lzl       2007-07-02 
02:49:41 UTC (rev 5567)
@@ -10,51 +10,7 @@
   wrong error is signalled).
 -->
 <library>
-  <!--
-    Test cases that depend on ActionScript semantics
-  -->
-  <class name="ActionScriptSemantics" extends="TestCase" 
semantics="'actionscript'">
-    <method name="setUp">
-      this.foo = {zot: "qux"};
-      this.nullvar = null;
-    </method>
 
-    <method name="tearDown">
-      delete this.foo;
-      delete this.nullvar;
-    </method>
-
-    <method name="testActionScriptSemantics">
-    <![CDATA[
-         // coercion of strings to booleans is fudged for Flash 4
-         // compatibility
-         if (canvas.runtime.indexOf("swf") == 0 && canvas.runtime < "swf7") {
-           assertFalse("non-empty", "'non-empty' is false");
-           assertFalse('0', "'0' is false");
-
-           // As is coercion of undefined to a string or number
-           assertEquals(String(undefined), '',
-                        "String(undefined) == ''");
-           assertEquals(Number(undefined), 0,
-                        "Number(undefined) == 0");
-           // Why do I need the explicit String coercion? 
-           assertEquals("foo", "" + {toString: function() {return "foo"}},
-                        "coercion to string");
-           // Henry's checks
-           assertSame(true, undefined < 1, "undefined < 1");
-           assertSame(true, undefined > -1, "undefined > -1");
-           assertEquals(0, Math.min(undefined, 1), "Math.min(undefined, 1) == 
0");
-           assertEquals(-1, Math.min(undefined, -1), "Math.min(undefined, -1) 
== -1");
-           assertEquals(1, Math.max(undefined, 1), "Math.max(undefined, 1) == 
1");
-           assertEquals(0, Math.max(undefined, -1), "Math.max(undefined, -1) 
== 0");
-         }
-         else {
-           Debug.write('ActionScriptSemantics: 11 tests skipped for runtime 
%s', canvas.runtime);
-         }
-    ]]>
-    </method>
-  </class>
-
   <!--
     Test cases that depend on JavaScript semantics
   -->
@@ -256,7 +212,7 @@
       assertFalse(0, "0 is false");
       assertFalse('', "'' is false");
       assertFalse(undefined, "undefined is false");
-      assertFalse(0/0, "NaN is false");
+      assertFalse(NaN, "NaN is false");
 
       assertEquals(null, undefined, "null == undefined");
       assertEquals('foo', 'foo', "'foo' == 'foo'");
@@ -388,16 +344,17 @@
     <!-- Override fail for testing purposes -->
     <method name="fail" args="message">
       <![CDATA[
-        dw("IntentionalFailures.fail(", message, ")");
         if (typeof(expectedFailure) == "null") {
             return super.fail(message);
         } else if (typeof(expectedFailure) == "function") {
             if (expectedFailure(message)) {
                 expectedFailures++;
+                Debug.info("Testing test system: '%0.24s' (above) is expected 
as part of this test", message);
                 return;
             }
         } else if (expectedFailure == message) {
             expectedFailures++;
+            Debug.info("Testing test system: '%0.24s' (above) is expected as 
part of this test", message);
             return;
         }
         super.fail(format("Wrong failure", expectedFailure,
@@ -418,6 +375,7 @@
 
     <method name="testFailure">
       expectedFailure = "This is an intentional failure"
+      Debug.debug("Testing test system: '%0.24s' will NOT be output as an 
error (even though you will get a message saying it is expected)", 
expectedFailure);
       fail(expectedFailure);
       assertEquals(expectedFailures, 1, "Total number of expected failures");
     </method>
@@ -443,7 +401,7 @@
       assertTrue(0, "Expected");
       assertTrue('', "Expected");
       assertTrue(undefined, "Expected");
-      assertTrue(0/0, "Expected");
+      assertTrue(NaN, "Expected");
       expectedFailure = null;
       assertEquals(12, expectedFailures, "Total number of expected failures");
       expectedFailure = ef;
@@ -563,13 +521,13 @@
             return super.error(message);
         } else if (typeof(expectedError) == "function") {
             if (expectedError(message)) {
-                Debug.write("Expected error: " + message);
                 expectedErrors++;
+                Debug.info("Testing error system: '%0.24s' (above) is expected 
as part of this test", message);
                 return;
             }
         } else if (expectedError == message) {
-            Debug.write("Expected error: " + message);
             expectedErrors++;
+            Debug.info("Testing error system: '%0.24s' (above) is expected as 
part of this test", message);
             return;
         }
         super.error(format("Wrong error", expectedError,
@@ -591,6 +549,7 @@
 
     <method name="testError">
       expectedError = "This is an intentional error";
+      Debug.debug("Testing error system: '%0.24s' will NOT be output as an 
error (even though you will get a message saying it is expected)", 
expectedError);
       error(expectedError);
       assertEquals(1, expectedErrors, "Total number of expected errors");
     </method>
@@ -605,18 +564,19 @@
       }
 
       expectedError.expectedMatch = "testing";
-      error("testing: 1, 2, 3");
+      var msg = "testing: 1, 2, 3";
+      Debug.debug("Testing error system: '%0.24s' will NOT be output as an 
error (even though you will get a message saying it is expected)", msg);
+      error(msg);
       assertEquals(1, expectedErrors, "Total number of expected errors");
 
       expectedError.expectedMatch = "This is a";
-      $reportSourceWarning(0, 0, "This is a test");
+      $reportSourceWarning(0, 0, "This is a test", true);
       assertEquals(2, expectedErrors, "Total number of expected errors");
 
-      // These tests only work if debugging is enabled
-      if (Debug) {
-
-          /* *** the code below is commented out because these are hard errors 
in DHTML JS ***
-
+      // Only test errors that are caught by the debug compiler for each 
runtime
+      if ($dhtml) {
+        // There are none for the dhtml compiler at present
+      } else {
         expectedError.expectedMatch = "flooglesnort";
         // TODO: [2002-11-16 ptw] below currently signals two errors
         undefined.flooglesnort;
@@ -652,16 +612,13 @@
         expectedError.expectedMatch = "undefined property";
         nonFunction[undefined] = 'this is an error';
         assertEquals(12, expectedErrors, "Total number of expected errors");
-          */
       }
-
-
       ]]>
     </method>
   </class>
 </library>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 

Modified: openlaszlo/branches/legals/test/smoke/simple.lzx
===================================================================
--- openlaszlo/branches/legals/test/smoke/simple.lzx    2007-07-01 06:43:36 UTC 
(rev 5566)
+++ openlaszlo/branches/legals/test/smoke/simple.lzx    2007-07-02 02:49:41 UTC 
(rev 5567)
@@ -10,15 +10,17 @@
     <!-- LZUnit Tests: verify it is working first -->
     <Tautologies /> 
     <JavaScriptSemantics />
-    <ActionScriptSemantics />
+    
     <IntentionalFailures />
+    
     <IntentionalErrors />
+
     <!-- end of LZUnit Tests -->
     <TestDebugger />
   </TestSuite>
 
 </canvas>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2006 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->

Modified: openlaszlo/branches/legals/test/smoke/smokecheck.lzx
===================================================================
--- openlaszlo/branches/legals/test/smoke/smokecheck.lzx        2007-07-01 
06:43:36 UTC (rev 5566)
+++ openlaszlo/branches/legals/test/smoke/smokecheck.lzx        2007-07-02 
02:49:41 UTC (rev 5567)
@@ -27,7 +27,6 @@
     <!-- LZUnit Tests: verify it is working first -->
     <Tautologies /> 
     <JavaScriptSemantics />
-    <ActionScriptSemantics />
     <IntentionalFailures />
     <IntentionalErrors />
     <!-- end of LZUnit Tests -->


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to