how to test forked morph rendering

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

how to test forked morph rendering

Tudor Girba-2
Hi,

I have a piece of code that builds a morph in a parallel process, and I would like to test that it builds the right thing.

The building of the morph can take long. My current solution is to add a delay, but this is ugly and unreliable:

"setup and trigger the morph building"
(Delay forMilliseconds: 1000) wait.
"assert that the morph is correct"

The question is if there is a better way.

Cheers,
Doru


--
www.tudorgirba.com

"We are all great at making mistakes."








Reply | Threaded
Open this post in threaded view
|

Re: how to test forked morph rendering

Hilaire Fernandes
Hi,

Your problem is Morph operation taking place only in the UI thread,
therefore blocking the user, is it that?

Hilaire

On 30/05/2012 07:43, Tudor Girba wrote:

> Hi,
>
> I have a piece of code that builds a morph in a parallel process, and I would like to test that it builds the right thing.
>
> The building of the morph can take long. My current solution is to add a delay, but this is ugly and unreliable:
>
> "setup and trigger the morph building"
> (Delay forMilliseconds: 1000) wait.
> "assert that the morph is correct"
>
> The question is if there is a better way.
>
> Cheers,
> Doru
>
>
> --
> www.tudorgirba.com
>
> "We are all great at making mistakes."
>
>
>
>
>
>
>
>
>


--
Dr. Geo -- http://www.drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: how to test forked morph rendering

Igor Stasenko
In reply to this post by Tudor Girba-2
I still remember that code a bit..
so, you need a place where you can hook in and validate the morph.
Piece of cake: in your watcher object, delegate the event "building
done" to some other object..
that "other object" in default case will use #addDeferredUIMessage...
and add this morph to scene.
And in case of test, you free to do anything else then..


On 30 May 2012 07:43, Tudor Girba <[hidden email]> wrote:

> Hi,
>
> I have a piece of code that builds a morph in a parallel process, and I would like to test that it builds the right thing.
>
> The building of the morph can take long. My current solution is to add a delay, but this is ugly and unreliable:
>
> "setup and trigger the morph building"
> (Delay forMilliseconds: 1000) wait.
> "assert that the morph is correct"
>
> The question is if there is a better way.
>
> Cheers,
> Doru
>
>
> --
> www.tudorgirba.com
>
> "We are all great at making mistakes."
>
>
>
>
>
>
>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: how to test forked morph rendering

Tudor Girba-2
Hi Igor,

I am not sure I understand. This would still not test the final logic, would it?

Cheers,
Doru


On 30 May 2012, at 14:15, Igor Stasenko wrote:

> I still remember that code a bit..
> so, you need a place where you can hook in and validate the morph.
> Piece of cake: in your watcher object, delegate the event "building
> done" to some other object..
> that "other object" in default case will use #addDeferredUIMessage...
> and add this morph to scene.
> And in case of test, you free to do anything else then..
>
>
> On 30 May 2012 07:43, Tudor Girba <[hidden email]> wrote:
>> Hi,
>>
>> I have a piece of code that builds a morph in a parallel process, and I would like to test that it builds the right thing.
>>
>> The building of the morph can take long. My current solution is to add a delay, but this is ugly and unreliable:
>>
>> "setup and trigger the morph building"
>> (Delay forMilliseconds: 1000) wait.
>> "assert that the morph is correct"
>>
>> The question is if there is a better way.
>>
>> Cheers,
>> Doru
>>
>>
>> --
>> www.tudorgirba.com
>>
>> "We are all great at making mistakes."
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.
>

--
www.tudorgirba.com

"Some battles are better lost than fought."




Reply | Threaded
Open this post in threaded view
|

Re: how to test forked morph rendering

Sean P. DeNigris
Administrator
In reply to this post by Tudor Girba-2
Tudor Girba-2 wrote
"setup and trigger the morph building"
(Delay forMilliseconds: 1000) wait.
"assert that the morph is correct"
I think more details about the code in the "setup and trigger" step would help... where exactly does the fork happen? Is the Morph added to the world?
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: how to test forked morph rendering

Igor Stasenko
In reply to this post by Tudor Girba-2
On 2 June 2012 22:58, Tudor Girba <[hidden email]> wrote:
> Hi Igor,
>
> I am not sure I understand. This would still not test the final logic, would it?
>
ok.. here the abstract code snippet.

w := Watcher new.

w delegate: myDelegate.

w buildThatMorph.

now as result..
you delegate receives a message #morphAreBuilt: with morph as argument.

so, you can choose either to add it to world,
or you can choose to test its contents without adding anywhere,
depending who is a delegate.


> Cheers,
> Doru
>
>
> On 30 May 2012, at 14:15, Igor Stasenko wrote:
>
>> I still remember that code a bit..
>> so, you need a place where you can hook in and validate the morph.
>> Piece of cake: in your watcher object, delegate the event "building
>> done" to some other object..
>> that "other object" in default case will use #addDeferredUIMessage...
>> and add this morph to scene.
>> And in case of test, you free to do anything else then..
>>
>>
>> On 30 May 2012 07:43, Tudor Girba <[hidden email]> wrote:
>>> Hi,
>>>
>>> I have a piece of code that builds a morph in a parallel process, and I would like to test that it builds the right thing.
>>>
>>> The building of the morph can take long. My current solution is to add a delay, but this is ugly and unreliable:
>>>
>>> "setup and trigger the morph building"
>>> (Delay forMilliseconds: 1000) wait.
>>> "assert that the morph is correct"
>>>
>>> The question is if there is a better way.
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "We are all great at making mistakes."
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko.
>>
>
> --
> www.tudorgirba.com
>
> "Some battles are better lost than fought."
>
>
>
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: how to test forked morph rendering

Igor Stasenko
or .. even simpler

watcher buildDatMorphAndPassItToTHisBlock: [:morph  |
  world adddeferreduimessage: [.,...]
or..

  mytest analyze: morph

]

what confuses you?

On 3 June 2012 01:20, Igor Stasenko <[hidden email]> wrote:

> On 2 June 2012 22:58, Tudor Girba <[hidden email]> wrote:
>> Hi Igor,
>>
>> I am not sure I understand. This would still not test the final logic, would it?
>>
> ok.. here the abstract code snippet.
>
> w := Watcher new.
>
> w delegate: myDelegate.
>
> w buildThatMorph.
>
> now as result..
> you delegate receives a message #morphAreBuilt: with morph as argument.
>
> so, you can choose either to add it to world,
> or you can choose to test its contents without adding anywhere,
> depending who is a delegate.
>
>
>> Cheers,
>> Doru
>>
>>
>> On 30 May 2012, at 14:15, Igor Stasenko wrote:
>>
>>> I still remember that code a bit..
>>> so, you need a place where you can hook in and validate the morph.
>>> Piece of cake: in your watcher object, delegate the event "building
>>> done" to some other object..
>>> that "other object" in default case will use #addDeferredUIMessage...
>>> and add this morph to scene.
>>> And in case of test, you free to do anything else then..
>>>
>>>
>>> On 30 May 2012 07:43, Tudor Girba <[hidden email]> wrote:
>>>> Hi,
>>>>
>>>> I have a piece of code that builds a morph in a parallel process, and I would like to test that it builds the right thing.
>>>>
>>>> The building of the morph can take long. My current solution is to add a delay, but this is ugly and unreliable:
>>>>
>>>> "setup and trigger the morph building"
>>>> (Delay forMilliseconds: 1000) wait.
>>>> "assert that the morph is correct"
>>>>
>>>> The question is if there is a better way.
>>>>
>>>> Cheers,
>>>> Doru
>>>>
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>>
>>>> "We are all great at making mistakes."
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Igor Stasenko.
>>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Some battles are better lost than fought."
>>
>>
>>
>>
>
>
>
> --
> Best regards,
> Igor Stasenko.



--
Best regards,
Igor Stasenko.