RegressionTests__StackFrameTest.st
author sr
Tue, 03 Mar 2020 16:37:35 +0100
changeset 2587 7d31bbc2c162
parent 2475 4f7b81468c3f
permissions -rw-r--r--
#BUGFIX by Stefan Reise class: RegressionTests::WebSocketTest::DemoWebSocketService removed: #acceptsWebSocket class: WebSocketTest class definition comment/format in: #serverWebSocket #tearDown changed: #clientWebSocket #communicationWithData:doAssert: #setUp class: WebSocketTest::DemoWebSocketService added: #acceptsWebSocket #acceptsWebSocket:

"{ Package: 'stx:goodies/regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#StackFrameTest
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression-RuntimeSystem'
!


!StackFrameTest methodsFor:'tests'!

deepRecursionTest
    |b|

    b := [:n |
            n printCR.
            b value:(n + 1)
         ].

    b value:1.

    "
     self new deepRecursionTest
    "
!

testUnlimitedStack1
    self 
        skipIf:(OperatingSystem isMSDOSlike and:[ExternalAddress pointerSize == 8])
        description:'Fails under Win64 (stx will exit), requires deeper inspection'.

    10 timesRepeat:[
        |a|

        a := Array with:('1' copy) with:('2' copy) with:('3' copy) with:('4' copy) with:('5' copy).
        self unlimitedStackTest1:a.
        true.
    ]

    "
     self run:#testUnlimitedStack1
    "
!

unlimitedStackTest1:anArray
"
[
    |a|

    a := Array with:'1' copy with:'2' copy with:'3' copy with:'4' copy with:'5' copy.
    self unlimitedStackTest1:a.
    true.
] whileTrue
"
%{  /* UNLIMITEDSTACK */

    OBJ __returnArray;
    OBJ __symbol;
    OBJ __returnCode;

    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[0])) {
        printf("OOPS\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[1])) {
        printf("OOPS\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[2])) {
        printf("OOPS\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[3])) {
        printf("OOPS\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[4])) {
        printf("OOPS\n");
    };
    __PROTECT__(anArray);
    __scavenge();
    __UNPROTECT__(anArray);


    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[0])) {
        printf("OOPS2\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[1])) {
        printf("OOPS2\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[2])) {
        printf("OOPS2\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[3])) {
        printf("OOPS2\n");
    };
    if (!__isStringLike(__ArrayInstPtr(anArray)->a_element[4])) {
        printf("OOPS2\n");
    };
%}.

    "Modified: / 22-03-2019 / 03:01:38 / Claus Gittinger"
! !

!StackFrameTest class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
! !