RegressionTests__WrongMethodCalledTest.st
author Claus Gittinger <cg@exept.de>
Thu, 09 Jun 2016 12:35:01 +0200
changeset 1438 d46e7b952634
parent 584 1e1641678bb5
child 1447 2351db93aa5b
child 1499 26a16a04219b
permissions -rw-r--r--
#DOCUMENTATION by cg class: exept_regression changed: #classNamesAndAttributes

"{ Package: 'exept:regression' }"

"{ NameSpace: RegressionTests }"

ApplicationModel subclass:#WrongMethodCalledTest
	instanceVariableNames:'vh1 vh2 updateProcess'
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression'
!

View subclass:#GraphicTestView
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	privateIn:WrongMethodCalledTest
!

!WrongMethodCalledTest class methodsFor:'documentation'!

documentation
"
    Run this multiple times with JIT turned off.

    In ST/X rel < 5.1.2, Sooner or later, the paint method
    will be invoked (illegally) via the fillRectangle selector
    and vice versa.
"
! !

!WrongMethodCalledTest class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:NewApplication1 andSelector:#windowSpec
     NewApplication1 new openInterface:#windowSpec
     NewApplication1 open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'NewApplication1'
          name: 'NewApplication1'
          min: (Point 10 10)
          max: (Point 1024 768)
          bounds: (Rectangle 12 22 312 322)
          menu: mainMenu
        )
        component: 
       (SpecCollection
          collection: (
           (NonScrollableArbitraryComponentSpec
              name: 'NonScrollableArbitraryComponent1'
              layout: (LayoutFrame 6 0 4 0 285 0 93 0)
              model: vh2
              component: GraphicTestView
            )
           (InputFieldSpec
              name: 'EntryField1'
              layout: (LayoutFrame 14 0 181 0 219 0 203 0)
              model: vh1
              type: number
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (InputFieldSpec
              name: 'EntryField2'
              layout: (LayoutFrame 14 0 144 0 219 0 166 0)
              model: vh1
              type: number
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (InputFieldSpec
              name: 'EntryField3'
              layout: (LayoutFrame 14 0 107 0 219 0 129 0)
              model: vh1
              type: number
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (InputFieldSpec
              name: 'EntryField4'
              layout: (LayoutFrame 14 0 218 0 219 0 240 0)
              model: vh1
              type: number
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           (InputFieldSpec
              name: 'EntryField5'
              layout: (LayoutFrame 14 0 255 0 219 0 277 0)
              model: vh1
              type: number
              acceptOnReturn: true
              acceptOnTab: true
              acceptOnLostFocus: true
              acceptOnPointerLeave: false
            )
           )
         
        )
      )
! !

!WrongMethodCalledTest class methodsFor:'menu specs'!

mainMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."

    "
     MenuEditor new openOnClass:RegressionTests::WrongMethodCalledTest andSelector:#mainMenu
     (Menu new fromLiteralArrayEncoding:(RegressionTests::WrongMethodCalledTest mainMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            label: 'File'
            translateLabel: true
            submenu: 
           (Menu
              (
               (MenuItem
                  label: 'Exit'
                  itemValue: closeRequest
                  translateLabel: true
                )
               )
              nil
              nil
            )
          )
         )
        nil
        nil
      )
! !

!WrongMethodCalledTest class methodsFor:'others'!

version_CVS
    ^ '$Header$'
! !

!WrongMethodCalledTest methodsFor:'aspects'!

vh1
    "automatically generated by UIPainter ..."

    "*** the code below creates a default model when invoked."
    "*** (which may not be the one you wanted)"
    "*** Please change as required and accept it in the browser."
    "*** (and replace this comment by something more useful ;-)"

    vh1 isNil ifTrue:[
        vh1 := 1 asValue
    ].
    ^ vh1.
!

vh2
    "automatically generated by UIPainter ..."

    "*** the code below creates a default model when invoked."
    "*** (which may not be the one you wanted)"
    "*** Please change as required and accept it in the browser."
    "*** (and replace this comment by something more useful ;-)"

    vh2 isNil ifTrue:[
        vh2 := 1 asValue
    ].
    ^ vh2.
! !

!WrongMethodCalledTest methodsFor:'initialization & release'!

closeRequest
    updateProcess terminate.
    super closeRequest.
!

postBuildWith:aBuilder
    |val|

    super postBuildWith:aBuilder.

    updateProcess := [
        [self window realized] whileTrue:[
            val := self vh1 value.
            val := (val + 1) \\ 100.
            self vh1 value:val.

            val := self vh2 value.
            val := (val + 1) \\ 100.
            self vh2 value:val.
        ].
    ] forkAt:4.
! !

!WrongMethodCalledTest::GraphicTestView methodsFor:'change & update'!

redraw
    self paint:Color red.
    self fillRectangle:(Rectangle origin:0@0 corner:30@40).
!

update:something with:aParameter from:where
    self redraw
! !

!WrongMethodCalledTest class methodsFor:'documentation'!

version
    ^ '$Header$'
! !