#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 12:17:18 +0100
changeset 737 a4f9d8da94aa
parent 736 481186cd77cf
child 738 19f75695aa0f
#FEATURE by cg class: TestCase changed: #run:beforeEachDo:afterEachDo:resetResources:debug:
TestCase.st
--- a/TestCase.st	Thu Mar 28 12:16:41 2019 +0100
+++ b/TestCase.st	Thu Mar 28 12:17:18 2019 +0100
@@ -990,16 +990,20 @@
     "1. Execute before block"
     "This code is ugly in Smalltalk/X but it is so because
      it is more portable - numArgs in ANSI (?)"
-    before numArgs == 2 ifTrue:[
-        before value: self value: result
+    Smalltalk isSmalltalkX ifTrue:[ 
+        before valueWithOptionalArgument:self and:result.   
     ] ifFalse:[
-        before numArgs == 1 ifTrue:[
-            before value: self
+        before numArgs == 2 ifTrue:[
+            before value: self value: result
         ] ifFalse:[
-            before value.
-        ]
+            before numArgs == 1 ifTrue:[
+                before value: self
+            ] ifFalse:[
+                before value.
+            ]
+        ].
     ].
-
+    
     "2. Run the testcase"
     reset ifTrue:[
         [
@@ -1014,20 +1018,25 @@
     "3. Execute after block"
     "This code is ugly in Smalltalk/X but it is so because
      it is more portable - numArgs in ANSI (?)"
-    after numArgs == 2 ifTrue:[
-        after value: self value: result
-    ] ifFalse:[
-        after numArgs == 1 ifTrue:[
-            after value: self
+    Smalltalk isSmalltalkX ifTrue:[ 
+        after valueWithOptionalArgument:self and:result.
+    ] ifFalse:[    
+        after numArgs == 2 ifTrue:[
+            after value: self value: result
         ] ifFalse:[
-            after value.
-        ]
+            after numArgs == 1 ifTrue:[
+                after value: self
+            ] ifFalse:[
+                after value.
+            ]
+        ].
     ].
     ^result
 
     "Created: / 29-07-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Created: / 21-08-2011 / 17:44:56 / cg"
     "Modified: / 13-07-2017 / 14:02:53 / cg"
+    "Modified: / 28-03-2019 / 11:16:47 / Claus Gittinger"
 !
 
 run: aResult beforeEachTestCaseDo:block1 afterEachTestCaseDo:block2