class: RegressionTests::STCCompilerTests
authorStefan Vogel <sv@exept.de>
Tue, 21 Jul 2015 11:32:27 +0200
changeset 1290 9575752f8c52
parent 1289 e1b9697a5b5e
child 1291 36b8896eb917
class: RegressionTests::STCCompilerTests fix testLongIntegerArray_02
RegressionTests__STCCompilerTests.st
--- a/RegressionTests__STCCompilerTests.st	Tue Jul 21 11:18:22 2015 +0200
+++ b/RegressionTests__STCCompilerTests.st	Tue Jul 21 11:32:27 2015 +0200
@@ -393,14 +393,15 @@
     "Created: / 17-09-2011 / 10:32:18 / cg"
 !
 
-test_LongIntegeraArray_01
-    | sizes |
+test_LongIntegerArray_01
+    |sizes|
+
     [
-       Class withoutUpdatingChangesDo:[
-
-           "/ Now, compile the same source using stc and check...
-           (STCCompilerInterface new)
-               compileToMachineCode:'longIntegerArray_size
+        Class 
+            withoutUpdatingChangesDo:[
+                "/ Now, compile the same source using stc and check...
+                (STCCompilerInterface new) 
+                    compileToMachineCode:'longIntegerArray_size
                     | arr size1 size2 |
 
                     arr := LongIntegerArray new: 8.
@@ -410,37 +411,34 @@
 %}.
                     ^ Array with: size1 with: size2.
    '
-               forClass:self class class
-               selector:#'longIntegerArray_size'
-               inCategory:'tests'
-               notifying:nil
-               install:true
-               skipIfSame:false
-               silent:true.
-
-           sizes := self class perform: #'longIntegerArray_size'.
-           self assert:(sizes first == 8).
-           self assert:(sizes second == 8).
-           self class class removeSelector:#longIntegerArray_size.
-       ].
-    ] ensure:[
-        self class class removeSelector:#longIntegerArray_size.
-    ]
+                    forClass:self class class
+                    selector:#'longIntegerArray_size'
+                    inCategory:'tests'
+                    notifying:nil
+                    install:true
+                    skipIfSame:false
+                    silent:true.
+                sizes := self class perform:#'longIntegerArray_size'.
+                self assert:(sizes first == 8).
+                self assert:(sizes second == 8).
+                self class class removeSelector:#'longIntegerArray_size'.
+            ].
+    ] ensure:[ self class class removeSelector:#'longIntegerArray_size'. ]
 
     "
      self run:#test02_compilation
-     self new test02_compilation
-    "
-
+     self new test02_compilation"
     "Created: / 04-03-2014 / 10:20:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-test_LongIntegeraArray_02
-    | sizes |
+test_LongIntegerArray_02
+    |sizes|
+
     [
-       Class withoutUpdatingChangesDo:[
-           (STCCompilerInterface new)
-               compileToMachineCode:'longIntegerArray_i_element
+        Class 
+            withoutUpdatingChangesDo:[
+                (STCCompilerInterface new) 
+                    compileToMachineCode:'longIntegerArray_i_element
                     | arr v1 v8 |
 
                     arr := LongIntegerArray new: 8.
@@ -452,94 +450,88 @@
 %{
                     __uint64__ val;
                     console_printf("arr: arr = 0x%x\n", (INT)arr);
+#if defined(__x86_64__)
+                    val = 0x0001000100010001;
+#else
                     val.lo = 1; val.hi = 1;
+#endif
                     val =  __LongIntegerArrayInstPtr(arr)->i_element[0];
-                    console_printf("v1: val.lo = %d, val.hi = %d\n", val.lo, val.hi);
+//                    console_printf("v1: val.lo = %d, val.hi = %d\n", val.lo, val.hi);
                     v1 = __MKUINT64(&val);
                     val =  __LongIntegerArrayInstPtr(arr)->i_element[7];
-                    console_printf("v2: val.lo = %d, val.hi = %d\n", val.lo, val.hi); 
+//                    console_printf("v2: val.lo = %d, val.hi = %d\n", val.lo, val.hi); 
                     v8 = __MKUINT64(&val);
 %}.
                     v1 errorPrintCR.
                     v8 errorPrintCR.
                     ^ Array with: v1 with: v8.
    '
-               forClass:self class class
-               selector:#'longIntegerArray_i_element'
-               inCategory:'tests'
-               notifying:nil
-               install:true
-               skipIfSame:false
-               silent:true.
-
-           1 to: 100 do:[:i|
-               ( 'Pass ', i printString ) errorPrintCR.
-               sizes := self class perform: #'longIntegerArray_i_element'.
-               self assert:(sizes first = 11123456789).
-               self assert:(sizes second = 11123456789).
-           ].
-           self class class removeSelector:#'longIntegerArray_i_element'.
-       ].
-    ] ensure:[
-        self class class removeSelector:#longIntegerArray_i_element.
-    ]
+                    forClass:self class class
+                    selector:#'longIntegerArray_i_element'
+                    inCategory:'tests'
+                    notifying:nil
+                    install:true
+                    skipIfSame:false
+                    silent:true.
+                1 to:100 do:[:i | 
+                    ('Pass ' , i printString) errorPrintCR.
+                    sizes := self class perform:#'longIntegerArray_i_element'.
+                    self assert:(sizes first = 11123456789).
+                    self assert:(sizes second = 11123456789).
+                ].
+                self class class removeSelector:#'longIntegerArray_i_element'.
+            ].
+    ] ensure:[ self class class removeSelector:#'longIntegerArray_i_element'. ]
 
     "
      self run:#test02_compilation
-     self new test02_compilation
-    "
-
+     self new test02_compilation"
     "Created: / 04-03-2014 / 10:21:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 26-06-2014 / 10:44:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-test_LongIntegeraArray_03
-    | arr scaveneges |
+test_LongIntegerArray_03
+    |arr scaveneges|
 
-    ( '=====' ) errorPrintCR.
-    arr := LongIntegerArray new: 8.
-    arr at: 1 put: 11123456789.
-    arr at: 8 put: 11123456789.
-    self assert: (arr at: 1) = 11123456789.
-    self assert: (arr at: 8) = 11123456789.
-    ( '   arr = 0x', (ObjectMemory addressOf: arr) hexPrintString ) errorPrintCR.  
-
-    1 to: 100 do:[:i |
-        ( 'Pass ', i printString ) errorPrintCR.
+    ('=====') errorPrintCR.
+    arr := LongIntegerArray new:8.
+    arr at:1 put:11123456789.
+    arr at:8 put:11123456789.
+    self assert:(arr at:1) = 11123456789.
+    self assert:(arr at:8) = 11123456789.
+    ('   arr = 0x' , (ObjectMemory addressOf:arr) hexPrintString) errorPrintCR.
+    1 to:100 do:[:i | 
+        ('Pass ' , i printString) errorPrintCR.
         scaveneges := ObjectMemory scavengeCount.
-        [ scaveneges == ObjectMemory scavengeCount ] whileTrue:[
+        [
+            scaveneges == ObjectMemory scavengeCount
+        ] whileTrue:[
             "/ Allocate some gagbage"
-            Array new: (Random nextIntegerBetween: 1 and: 100)
+            Array new:(Random nextIntegerBetween:1 and:100)
         ].
-        ( 'B: arr = 0x', (ObjectMemory addressOf: arr) hexPrintString ) errorPrintCR.
-        ( '   arr at: 1 ==> ', (arr at: 1) printString) errorPrintCR.
-        ( '   arr at: 8 ==> ', (arr at: 8) printString) errorPrintCR.
-        self assert: (arr at: 1) = 11123456789.
-        self assert: (arr at: 8) = 11123456789.
-        ( 'A: arr = 0x', (ObjectMemory addressOf: arr) hexPrintString ) errorPrintCR.
+        ('B: arr = 0x' , (ObjectMemory addressOf:arr) hexPrintString) errorPrintCR.
+        ('   arr at: 1 ==> ' , (arr at:1) printString) errorPrintCR.
+        ('   arr at: 8 ==> ' , (arr at:8) printString) errorPrintCR.
+        self assert:(arr at:1) = 11123456789.
+        self assert:(arr at:8) = 11123456789.
+        ('A: arr = 0x' , (ObjectMemory addressOf:arr) hexPrintString) errorPrintCR.
     ]
 
-
-
-
-
-
     "
      self run:#test_LongIntegeraArray_03
-     self new test_LongIntegeraArray_03
-    "
-
+     self new test_LongIntegeraArray_03"
     "Created: / 26-06-2014 / 12:21:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-test_SignedLongIntegeraArray_01
-    | sizes |
+test_SignedLongIntegerArray_01
+    |sizes|
+
     [
-       Class withoutUpdatingChangesDo:[
-
-           "/ Now, compile the same source using stc and check...
-           (STCCompilerInterface new)
-               compileToMachineCode:'signedLongIntegerArray_size
+        Class 
+            withoutUpdatingChangesDo:[
+                "/ Now, compile the same source using stc and check...
+                (STCCompilerInterface new) 
+                    compileToMachineCode:'signedLongIntegerArray_size
                     | arr size1 size2 |
 
                     arr := SignedLongIntegerArray new: 8.
@@ -549,37 +541,34 @@
 %}.
                     ^ Array with: size1 with: size2.
    '
-               forClass:self class class
-               selector:#'signedLongIntegerArray_size'
-               inCategory:'tests'
-               notifying:nil
-               install:true
-               skipIfSame:false
-               silent:true.
-
-           sizes := self class perform: #'signedLongIntegerArray_size'.
-           self assert:(sizes first == 8).
-           self assert:(sizes second == 8).
-           self class class removeSelector:#signedLongIntegerArray_size.
-       ].
-    ] ensure:[
-        self class class removeSelector:#signedLongIntegerArray_size.
-    ]
+                    forClass:self class class
+                    selector:#'signedLongIntegerArray_size'
+                    inCategory:'tests'
+                    notifying:nil
+                    install:true
+                    skipIfSame:false
+                    silent:true.
+                sizes := self class perform:#'signedLongIntegerArray_size'.
+                self assert:(sizes first == 8).
+                self assert:(sizes second == 8).
+                self class class removeSelector:#'signedLongIntegerArray_size'.
+            ].
+    ] ensure:[ self class class removeSelector:#'signedLongIntegerArray_size'. ]
 
     "
      self run:#test02_compilation
-     self new test02_compilation
-    "
-
+     self new test02_compilation"
     "Created: / 04-03-2014 / 10:11:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-test_SignedLongIntegeraArray_02
-    | sizes |
+test_SignedLongIntegerArray_02
+    |sizes|
+
     [
-       Class withoutUpdatingChangesDo:[
-           (STCCompilerInterface new)
-               compileToMachineCode:'signedLongIntegerArray_i_element
+        Class 
+            withoutUpdatingChangesDo:[
+                (STCCompilerInterface new) 
+                    compileToMachineCode:'signedLongIntegerArray_i_element
                     | arr v1 v8 |
 
                     arr := SignedLongIntegerArray new: 8.
@@ -596,28 +585,23 @@
 %}.
                     ^ Array with: v1 with: v8.
    '
-               forClass:self class class
-               selector:#'signedLongIntegerArray_i_element'
-               inCategory:'tests'
-               notifying:nil
-               install:true
-               skipIfSame:false
-               silent:true.
-
-           sizes := self class perform: #'signedLongIntegerArray_i_element'.
-           self assert:(sizes first = 1123456789).
-           self assert:(sizes second = 1123456789).
-           self class class removeSelector:#'signedLongIntegerArray_i_element'.
-       ].
-    ] ensure:[
-        self class class removeSelector:#signedLongIntegerArray_i_element.
-    ]
+                    forClass:self class class
+                    selector:#'signedLongIntegerArray_i_element'
+                    inCategory:'tests'
+                    notifying:nil
+                    install:true
+                    skipIfSame:false
+                    silent:true.
+                sizes := self class perform:#'signedLongIntegerArray_i_element'.
+                self assert:(sizes first = 1123456789).
+                self assert:(sizes second = 1123456789).
+                self class class removeSelector:#'signedLongIntegerArray_i_element'.
+            ].
+    ] ensure:[ self class class removeSelector:#'signedLongIntegerArray_i_element'. ]
 
     "
      self run:#test02_compilation
-     self new test02_compilation
-    "
-
+     self new test02_compilation"
     "Created: / 04-03-2014 / 10:13:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !