Re: test for default history content

David,
   I'll have to think about those tests.  The obvious way to test 
whether a state is entered or not is to raise and event or set a flag in 
its onentry handler, but  history doesn't have an onentry handler.  
However it should be easy enough to test that the default executable 
content gets executed only the first time through the history state.

- Jim
On 3/29/2014 6:02 AM, David Junger wrote:
> Le 28 mar 2014 à 21:15, Jim Barnett <1jhbarnett@gmail.com> a écrit :
>
>> I've added test579 to the suite.  Let me know if there are problems with it or if you think there need to be more/different tests.
> At first it passed with my implementation because of an "interesting" bug where JSSC would add the <history> element to the initial configuration, and take a microstep from there to what should have been the initial configuration, using the transition in the history as a regular transition.
> So the <initial> executable content was executed during onentry phase right after its parent's onentry as specified, but the <history>'s content was executed during the transition phase in the following microstep (which, given the context, resulted in queueing the events in the expected order and passing the test).
>
> I fixed all that, but maybe we could have an extra test that ensures <history> doesn't end up in the configuration and its <transition> doesn't get enabled in the normal event loop. None of the existing tests was able to catch that bug (and it only occured when an initial element or attribute pointed to a history, not when history was targetted directly by a transition).
>
> Also, add another test that a default <history> transition can target a substate's own <history>, and still end the microstep in a legal configuration. Maybe even by going through initial transitions.
>
> 			David

-- 
Jim Barnett
Genesys

Received on Saturday, 29 March 2014 13:28:10 UTC