<div dir="ltr">"Note this requires..." System-cmm.1353.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 31, 2022 at 5:53 PM <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Chris Muller uploaded a new version of KernelTests to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/KernelTests-cmm.423.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/KernelTests-cmm.423.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: KernelTests-cmm.423<br>
Author: cmm<br>
Time: 31 May 2022, 5:53:42.444296 pm<br>
UUID: a504f011-37fb-4d93-ae2f-c3e1fc832b49<br>
Ancestors: KernelTests-nice.422<br>
<br>
#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.<br>
        Note this requires<br>
<br>
=============== Diff against KernelTests-nice.422 ===============<br>
<br>
Item was changed:<br>
  ----- Method: AllocationTest>>testOutOfMemorySignalExtreme (in category 'tests') -----<br>
  testOutOfMemorySignalExtreme<br>
+       "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."<br>
+       Smalltalk heapMemoryLimit ifNotNil:<br>
+               [ : bytes |<br>
+               self<br>
+                       should: [ Array new: (bytes // Smalltalk wordSize) + 100 ]<br>
+                       raise: OutOfMemory, Error<br>
+                       withExceptionDo:<br>
+                               [:ex|<br>
+                                ex class == Error ifTrue:<br>
+                                       [self assert: [ex messageText includesSubstring: 'basicNew: with invalid argument' ]]]]!<br>
-       "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. :-)<br>
-       <br>
-       Note that current (2017) Spur VMs fail in #new: and #basicNew: with #'bad argument' if given other than a non-negative SmallInteger.<br>
-       <br>
-       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..."<br>
-       <br>
-       | sz |<br>
-       sz := 1024*1024*1024*1024. "= 1 TiB"<br>
-       self should: [Array new: sz]<br>
-               raise: OutOfMemory, Error<br>
-               withExceptionDo:<br>
-                       [:ex|<br>
-                        ex class == Error ifTrue:<br>
-                               [self assert: [ex messageText includesSubstring: 'basicNew: with invalid argument']]]!<br>
<br>
<br>
</blockquote></div>