|Anonymous | Login||11-13-2019 05:20 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details [ Jump to Notes ]||[ View Advanced ] [ Issue History ] [ Print ]|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0007067||[Squeak] Morphic||minor||always||05-25-08 03:14||06-04-08 04:16|
|Summary||0007067: [BUG] [FIX] LedDigitMorph does not change digit state automatically.|
In the new Squeak3.10-7159-basic.image, LedDigitMorph does not change its state after receiving a digit: message. You have to click on the morph before it changes. The test case is:
myDigit := LedDigitMorph new openInWorld.
myDigit digit: 2.
Could be that it was designed this way, but I thought it was annoying.
To fix this, change digit: method in LedDigitMorph
digit _ anInteger \\ 10 "make sure it stays between 0 and 9"
digit _ anInteger \\ 10. "make sure it stays between 0 and 9"
(0012164 - 610 - 736 - 736 - 736 - 736 - 736)
edited on: 05-25-08 19:34
Your analysis looks right.
It would be good if you could provide the patch in the form of a fix.
(do a fileout of the corrected method and post it here).
It would also be good if you could create an sunit test. One that fails before the patch and passes afterwards.
That will help prevent the future undoing of the fix.
Yours in service and curiosity, --Jerome Peace
P.s. you might want to add a guard clause to insure that change happened.
If new and old digits are the same do nothing.
If led has no owner (or is invisible) no change to the display is needed.
(0012249 - 228 - 252 - 252 - 252 - 252 - 252)
I'll see what I can do to clean this up properly and submit a patch. I'm fairly new to Squeak, so it might take me a bit. Though I'm happy to work on it (seems like a good beginners project).
Thanks for the feedback.
(0012251 - 917 - 1043 - 1043 - 1043 - 1043 - 1043)
Thanks for taking up the challenge.
For the test itself you want to test that the screen gets updated.
So put an led on the screen (or two for comparison).
Get a form from the display at the led.
Update the led.
Make the world update or wait till the world updates.
Get another form from the same location.
Compare the two forms.
The unupdated form would match the updated one would not.
Or you could display a reference led with the before or after value and check the forms against that.
For setup and teardown look at the MorphicUITests. I like to put morphs I am displaying into the cases array and then have the teardown delete them.
So I subclass tests of this type under the MorphicUITests because then the setup teardown stuff is present and I don't have to duplicate it.
Look at the other tests in that class for examples.
Yours in curiosity and service, --Jerome Peace
|05-25-08 03:14||jburke71||New Issue|
|05-25-08 19:25||wiz||Note Added: 0012164|
|05-25-08 19:31||wiz||Note Edited: 0012164|
|05-25-08 19:34||wiz||Note Edited: 0012164|
|06-03-08 18:39||jburke71||Note Added: 0012249|
|06-04-08 04:16||wiz||Note Added: 0012251|
| Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
46 total queries executed.|
31 unique queries executed.