The Trunk: Tests-ul.325.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tests-ul.325.mcz

commits-2
Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.325.mcz

==================== Summary ====================

Name: Tests-ul.325
Author: ul
Time: 21 August 2015, 6:54:49.29 pm
UUID: 6f7b12eb-731b-47d2-b193-2af9cb085864
Ancestors: Tests-topa.324

Increased maxLiterals in CompilerTest's #testMaxLiterals and #testMaxLiteralsWithClassReferenceInClosure to make them pass again.
In theory Spur supports literals up to 65535, but I think the compiler will have to be changed to be able to use that many.

=============== Diff against Tests-topa.324 ===============

Item was changed:
  ----- Method: CompilerTest>>testMaxLiterals (in category 'limits') -----
  testMaxLiterals
  "Document the maximum number of literals in a compiled method"
 
  | maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
+ maxLiterals := 250.
- maxLiterals := 249.
  stringThatCanBeCompiled := '{ ', (String streamContents: [:strm |
  1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
  stringWithOneTooManyLiterals := '{ ', (String streamContents: [:strm |
  1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
  self assert: ((1 to: maxLiterals) collect: #printString) equals: (Compiler evaluate: stringThatCanBeCompiled).
 
  "If the following test fails, it means that the limit has been raised or eliminated,
  and this test should be updated to reflect the improvement."
  self should: [Compiler evaluate: stringWithOneTooManyLiterals] raise: Error.
  !

Item was changed:
  ----- Method: CompilerTest>>testMaxLiteralsWithClassReferenceInClosure (in category 'limits') -----
  testMaxLiteralsWithClassReferenceInClosure
  "Document the maximum number of literals in a compiled method. A class
  reference in a closure reduces the maximum literals."
 
  | maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
+ maxLiterals := 245.
- maxLiterals := 244.
  stringThatCanBeCompiled := '[ DateAndTime now. Date today. Time ]. { ',
  (String streamContents: [:strm |
  1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
  stringWithOneTooManyLiterals := '[ DateAndTime now. Date today. Time ]. { ',
  (String streamContents: [:strm |
  1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
  self assert: maxLiterals equals: (Compiler evaluate: stringThatCanBeCompiled) size.
 
  "If the following test fails, it means that the limit has been raised or eliminated,
  and this test should be updated to reflect the improvement."
  self should: [Compiler evaluate: stringWithOneTooManyLiterals] raise: Error.
  !