RegressionTests__NumberTest.st
author Claus Gittinger <cg@exept.de>
Fri, 10 Sep 2004 13:01:29 +0200
changeset 242 43a9bab802ff
child 309 f5c2d68a0ad2
permissions -rw-r--r--
initial checkin

"{ Package: 'exept:regression' }"

"{ NameSpace: RegressionTests }"

TestCase subclass:#NumberTest
	instanceVariableNames:'a b'
	classVariableNames:''
	poolDictionaries:''
	category:'tests-Regression'
!


!NumberTest methodsFor:'accessing'!

a
    ^ a
!

a:something
    a := something.
!

b
    ^ b
!

b:something
    b := something.
! !

!NumberTest methodsFor:'tests - concrete bugs'!

test_eqNumberBug
    "reported 09-09-2004;
     stc generated wrong code for some inlined = - compare (shame)."

    Class withoutUpdatingChangesDo:[
        self class 
            compile:
'testEQ
    a = b ifTrue:[^ false].
    ^ true.
'
            classified:'temporary'.
    ].

    self assert: (
       (self
           a:0;
           b:0) testEQ ) == false.

    self assert: (
       (self
           a:0;
           b:0.0) testEQ ) == false.

    self assert: (
       (self
           a:0.0;
           b:0) testEQ ) == false.

    self assert: (
       (self
           a:0.0;
           b:0.0) testEQ ) == false.

    Class withoutUpdatingChangesDo:[
        Compiler
            stcCompileMethod:(self class compiledMethodAt:#testEQ).
    ].

    self assert: (
       (self
           a:0;
           b:0) testEQ ) == false.

    self assert: (
       (self
           a:0;
           b:0.0) testEQ ) == false.

    self assert: (
       (self
           a:0.0;
           b:0) testEQ ) == false.

    self assert: (
       (self
           a:0.0;
           b:0.0) testEQ ) == false.

    Class withoutUpdatingChangesDo:[
        self class removeSelector:#testEQ
    ].

    "
     self new test_eqNumberBug
    "
! !

!NumberTest class methodsFor:'documentation'!

version
    ^ '$Header$'
! !