[squeak-dev] The Trunk: KernelTests-cmm.423.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jun 2 14:51:04 UTC 2022


Marcel Taeumel uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-cmm.423.mcz

==================== Summary ====================

Name: KernelTests-cmm.423
Author: cmm
Time: 31 May 2022, 5:53:42.444296 pm
UUID: a504f011-37fb-4d93-ae2f-c3e1fc832b49
Ancestors: KernelTests-nice.422

#testOutOfMemorySignalExtreme can be stressful on a system that running the Squeak VM unconstrained (which is the default).  Therefore, only run it if the vm is explicitly constrained.
	Note this requires

=============== Diff against KernelTests-nice.422 ===============

Item was changed:
  ----- Method: AllocationTest>>testOutOfMemorySignalExtreme (in category 'tests') -----
  testOutOfMemorySignalExtreme
+ 	"Try to allocate more memory than permitted by the -memory vm argument, and check whether the expected error is signaled.  Note that current (2017) Spur VMs fail in #new: and #basicNew: with #'bad argument' if given other than a non-negative SmallInteger."
+ 	Smalltalk heapMemoryLimit ifNotNil:
+ 		[ : bytes |
+ 		self
+ 			should: [ Array new: (bytes // Smalltalk wordSize) + 100 ]
+ 			raise: OutOfMemory, Error
+ 			withExceptionDo:
+ 				[:ex|
+ 				 ex class == Error ifTrue:
+ 					[self assert: [ex messageText includesSubstring: 'basicNew: with invalid argument' ]]]]!
- 	"Try to allocate a ridiculous amount of memory and check whether the expected error is signaled. Call Eliot when this test fails, he want your machine. :-)
- 	
- 	Note that current (2017) Spur VMs fail in #new: and #basicNew: with #'bad argument' if given other than a non-negative SmallInteger.
- 	
- 	Also note that this test can be quite stressful to your machine depending on how your operating system allocates the required memory behind the curtains. Better not triggering some robot fetching a tape from somewhere..."
- 	
- 	| sz |
- 	sz := 1024*1024*1024*1024. "= 1 TiB"
- 	self should: [Array new: sz]
- 		raise: OutOfMemory, Error
- 		withExceptionDo:
- 			[:ex|
- 			 ex class == Error ifTrue:
- 				[self assert: [ex messageText includesSubstring: 'basicNew: with invalid argument']]]!



More information about the Squeak-dev mailing list