Convert to TestCase
authorStefan Vogel <sv@exept.de>
Fri, 26 Sep 2003 16:12:26 +0200
changeset 207 87172b332b24
parent 206 5afc9d56ef2c
child 208 4db1efdbce2e
Convert to TestCase
RegressionTests__EnumerationTests.st
--- a/RegressionTests__EnumerationTests.st	Sat Jun 21 14:12:33 2003 +0200
+++ b/RegressionTests__EnumerationTests.st	Fri Sep 26 16:12:26 2003 +0200
@@ -2,7 +2,7 @@
 
 "{ NameSpace: RegressionTests }"
 
-Object subclass:#EnumerationTests
+TestCase subclass:#EnumerationTests
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
@@ -33,6 +33,29 @@
     "
 ! !
 
+!EnumerationTests methodsFor:'tests'!
+
+testArrayKeysAndValuesDo
+    "test GC while enumerating an array"
+
+    |a|
+
+    a := (1 to:100) asArray.
+
+    10 timesRepeat:[
+        a keysAndValuesDo:[:index :val |
+            ObjectMemory scavenge.
+            index printString.
+            ObjectMemory scavenge.
+            val printString.
+        ]
+    ]
+
+    "
+     self testArrayKeysAndValuesDo
+    "
+! !
+
 !EnumerationTests class methodsFor:'documentation'!
 
 version