Make 3.9 Green
Last updated at 2:53 pm UTC on 4 November 2006
Ralph Johnson complained (rightfully IMHO) that the unit tests in a release image should all be green.
Although there are some tests which can't be green in all circumstances, I think that we should at least come near the goal. – hmm (hmm's response)
This page is a place where every failing unit test in the 3.9 image (I'm talking about R3-7066) and proposed fixes can be discussed.
Let's start by listing the failures and errors:
- ClassTest>>#testRootsOfTheWorld does not seem to fail when run by clicking on it. Is there a problem with the unit testing framework?
- This test does not fail for me. (lr)
- Strangely enough, it only fails in my image when I run all tests at once. This one seems to be related to some Traits test which probably leaves obsolete classes with nil superclass around – hmm
- ColorTest>>#testPrintHTMLString the method Color>>#printHtmlString does not prepend leading zeros to values below hex 10. This is easy to fix!
- Seaside had this patched since a long time as follows: (lr)
^ '#' , self hex
| aStream |
aStream := (String new: 6) writeStream.
aStream nextPutAll: (((self red * 255) asInteger printStringBase: 16)
padded: #left to: 2 with: $0).
aStream nextPutAll: (((self green * 255) asInteger printStringBase: 16)
padded: #left to: 2 with: $0).
aStream nextPutAll: (((self blue * 255) asInteger printStringBase: 16)
padded: #left to: 2 with: $0).
^ aStream contents
- FloatMathPluginTests>>#testTan obviously produces different results on my machine than on that of the developer. I think there was some discussion regarding a Float plugin with reproducible behavior for Croquet, this might be related. The VM I'm using has built in "FloatMathPlugin 23 April 2006 (i)".
- MCSnapshotBrowserTest>>#testButtonMutex The snapshot tool defines its buttons using arrays of 5 elements, which is handled correctly by MCToolWindowBuilder>>#buttonRow: but not by MCTool>>#buttonRow:.
- MCWorkingCopyTest>>#testNaming Monticello seems to have some memory of version numbers buried deep within.
- MCWorkingCopyTest>>#testRepositoryFallback ???
- MVCToolBuilderTests>>#testButtonInitiallyDisabled MVC buttons do not have enablement.
- MVCToolBuilderTests>>#testButtonInitiallyDisabledSelector dito.
- MVCToolBuilderTests>>#testGetButtonColor button colors are not supported in MVC.
- ... further MVCToolBuilderTests failures skipped due to lack of time
- NumberParsingTest>>#testFloatReadError IIRC there has been discussion whether reading of a number from an empty stream should return 0 or an error. The test assumes an error, but the 3.9 code returns 0.
- ObjectFinalizerTests>>#testFinalizationOfEquals This one is interesting and merits further debugging. Might be some weird kind of race condition.
- ReleaseTest>>#testUnimplementedNonPrimitiveCalls This is not really a unit test but a lint test. The results are interesting in that they point to possible errors, but this should be handled in a different context (just my opinion).
- SMDependencyTest>>#test1 I don't know SqueakMap well enough to judge what should be done here.
- SMDependencyTest>>#test3 dito.
- StringTest>>#testIndexOf String class>>#findFirstInString:inSet:startingAt: is implemented incorrectly for the case where the character to find is the last in the string. This is easy to fix!
- TestIndenting>>#testBreak1 This probably shows a long-standing bug in the non-morphic text wrapping code which was introduced with the multinationalization. Now's a good time to fix this!
- This test seems to be based on a specific font. It uses DefaultTextStyle and more or less tests will fail if you change to another font.(KFR)
- TestIndenting>>#testBreak2 dito.
- TimeTest>>#testSqueakInquiries This one is a gem! it tests whether #humanWordsForSecondsAgo: 90000 returns 'yesterday'. This is bound to fail between 12 am and 1 am :-)
- ComplexTest>>#testEquality The method Complex>>#= does not send #isNumber to its argument, so it fails when comparing to nil or other non-numeric arguments. This is easy to fix!
- FloatMathPluginTests>>#testArcCos can't possibly work - the arcCos function is only defined for arguments in range -1..1.
- FloatMathPluginTests>>#testArcCosH don't know which argument range is permitted, but probably similar to arcCos.
- FloatMathPluginTests>>#testArcSin similar to arcCos.
- FloatMathPluginTests>>#testArcTanH don't know which argument range is permitted, but probably similar to arcCos.
- MVCToolBuilderTests>>#testAddAction can't work because MVCToolBuilder does not implement #buildPluggableMenu:.
- MVCToolBuilderTests>>#testAddTargetSelectorArgumentList dito.
- MVCToolBuilderTests>>#testButtonFiresBlock can't work since in MVC, actions must be selectors, not blocks. Possible fix: implement Block actions in MVC
- MVCToolBuilderTests>>#testButtonFiresMessage dito for MessageSend actions.
- MVCToolBuilderTests>>#testTreeExpandPath #pluggableTreeSpec returns nil in MVCToolBuilder since MVC does not implement trees.
- MVCToolBuilderTests>>#testTreeExpandPathFirst dito.
- MVCToolBuilderTests>>#testTreeGetSelectionPath dito.
- MVCToolBuilderTests>>#testTreeRoots dito.
- MVCToolBuilderTests>>#testTreeWidgetID dito.
- MVCToolBuilderTests>>#testWindowCloseAction can only work when running in MVC.
- MorphicToolBuilderTests>>#testAddAction does not work since the MorphicToolBuilder expects a MessageSend action, but the test case uses a Symbol.
Most of the failing test cases are MVCToolBuilder related. Since spicing up MVC with all the required functionality is probably not a primary goal, another option might be to override all the failing tests with no-ops.
If you check on mantis you will see a lot of 3.9 tests, bugs, and fixes.
One class of cleanups that do not have test yet is unimplemented calls.
The image should have no unexplained unimplemented calls. It has plenty. A total of 187 unimplemented methods.
Most of them are indications of things that need to be removed or cleaned up.
Some part of this page and its effort should probably have a report on mantis also. –wiz
Ok, what about including a reference to the mantis bug report for those bugs which have one? I'll try to do this for some, but probably won't be able to do it for all. – hmm
Here's a changeset which overrides the MVCToolBuilderTests methods and fixes the Color and Complex bugs: