Skip to content

Commit

Permalink
add test377
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-embedded committed Jul 30, 2018
1 parent e336418 commit acb6357
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/all-tests.h
Expand Up @@ -57,6 +57,14 @@ TEST(w3c, 376)
EXPECT_EQ(typeid(sc_test376::state_pass), typeid(*sc.cur_state));
}

// test that onexit handlers are executed in document order. event1 should be raised before event2
TEST(w3c, 377)
{
sc_test377 sc;
sc.init();
EXPECT_EQ(typeid(sc_test377::state_pass), typeid(*sc.cur_state));
}

// test that executable content in the <initial> transition executes after the onentry handler on the state
// and before the onentry handler of the child states. Event1, event2, and event3 should occur in that order.
TEST(w3c, 412)
Expand Down Expand Up @@ -348,5 +356,4 @@ TEST(lcca_parallel, 0)
EXPECT_EQ(typeid(sc_lcca_parallel::state_A1), typeid(*sc.cur_state[2]));
}


#endif
1 change: 1 addition & 0 deletions src/test/test.cpp
Expand Up @@ -10,6 +10,7 @@
#include "test570.h"
#include "test375.h"
#include "test376.h"
#include "test377.h"
#include "test576.h"
#include "event_list.h"
#include "event_tokens.h"
Expand Down
35 changes: 35 additions & 0 deletions src/test/test377.txml
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!-- test that onexit handlers are executed in document order. event1 should be raised before event2 -->


<scxml conf:datamodel="" version="1.0" xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance">



<state id="s0">
<onexit>
<raise event="event1"/>
</onexit>
<onexit>
<raise event="event2"/>
</onexit>

<transition target="s1"/>
</state>

<state id="s1">

<transition event="event1" target="s2"/>
<transition event="*" conf:targetfail=""/>

</state>

<state id="s2">
<transition event="event2" conf:targetpass=""/>
<transition event="*" conf:targetfail=""/>
</state>


<conf:pass/>
<conf:fail/>
</scxml>
1 change: 1 addition & 0 deletions src/test/test_t.cpp
Expand Up @@ -12,6 +12,7 @@
#include "test570_t.h"
#include "test375_t.h"
#include "test376_t.h"
#include "test377_t.h"
#include "test576_t.h"
#include "event_list_t.h"
#include "event_tokens_t.h"
Expand Down

0 comments on commit acb6357

Please sign in to comment.