Andreas Raab uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ar.117.mcz==================== Summary ====================
Name: KernelTests-ar.117
Author: ar
Time: 4 December 2009, 2:18:34 am
UUID: 367a2844-bcb2-6c4d-94ff-574636422c6b
Ancestors: KernelTests-ul.116
AllocationTests covering the behavior on excessive allocations.
=============== Diff against KernelTests-ul.116 ===============
Item was added:
+ ----- Method: AllocationTest>>testOneMegAllocation (in category 'tests') -----
+ testOneMegAllocation
+ "Documentating a weird bug in the allocator"
+ | sz array failed |
+ failed := false.
+ sz := 1024*1024.
+ array := [Array new: sz] on: OutOfMemory do:[:ex| failed := true].
+ self assert: (failed or:[array size = sz]).
+ !
Item was added:
+ ----- Method: AllocationTest>>testOutOfMemorySignal (in category 'tests') -----
+ testOutOfMemorySignal
+ "Ensure that OOM is signaled eventually"
+ | sz |
+ sz := 512*1024*1024. "work around the 1GB alloc bug"
+ self should:[2000 timesRepeat:[Array new: sz]] raise: OutOfMemory.
+
+ "Call me when this test fails, I want your machine"
+ sz := 1024*1024*1024*1024.
+ self should:[Array new: sz] raise: OutOfMemory.
+ !
Item was added:
+ TestCase subclass: #AllocationTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'KernelTests-Objects'!
Item was added:
+ ----- Method: AllocationTest>>testOneGigAllocation (in category 'tests') -----
+ testOneGigAllocation
+ "Documentating a weird bug in the allocator"
+ | sz array failed |
+ failed := false.
+ sz := 1024*1024*1024.
+ array := [Array new: sz] on: OutOfMemory do:[:ex| failed := true].
+ self assert: (failed or:[array size = sz]).
+ !