Skip to content
Permalink
Browse files

Merge pull request #105 from jp-embedded/issue_97

Issue 97
  • Loading branch information...
jp-embedded committed Aug 18, 2019
2 parents eeaec07 + 12ea79c commit b73c7e7424bc10bffb5f036ae7c82f8f523b64f2

Large diffs are not rendered by default.

@@ -366,7 +366,19 @@ $(OutDir)scxmlcc.exe %(RelativeDir)%(Filename).scxml</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">scxmlcc %(FullPath)</Message>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkObjects>
</CustomBuild>
<CustomBuild Include="..\..\test\issue_94.scxml">
<CustomBuild Include="..\..\test\issue_94.scxml">
<SubType>Designer</SubType>
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)scxmlcc.exe %(RelativeDir)%(Filename)%(Extension)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(RelativeDir)%(Filename).h</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)scxmlcc.exe %(RelativeDir)%(Filename)%(Extension)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(RelativeDir)%(Filename).h</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">scxmlcc %(FullPath)</Message>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">scxmlcc %(FullPath)</Message>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkObjects>
</CustomBuild>
<CustomBuild Include="..\..\test\issue_97.scxml">
<SubType>Designer</SubType>
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)scxmlcc.exe %(RelativeDir)%(Filename)%(Extension)</Command>
@@ -86,6 +86,9 @@
<CustomBuild Include="..\..\test\issue_94.scxml">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\..\test\issue_97.scxml">
<Filter>Source Files</Filter>
</CustomBuild>
<CustomBuild Include="..\..\test\eventless.scxml">
<Filter>Source Files</Filter>
</CustomBuild>
@@ -63,6 +63,7 @@ scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/issue_69.scxml gen_src )
scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/issue_72.scxml gen_src )
scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/issue_88.scxml gen_src )
scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/issue_94.scxml gen_src )
scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/issue_97.scxml gen_src )
scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/eventless.scxml gen_src )
scxmlcc_generator( ${CMAKE_CURRENT_SOURCE_DIR}/stringevents.scxml gen_src )

@@ -23,8 +23,8 @@ TEST(w3c, 355)
// If we get to s01111 we succeed, if any other state, failure.
TEST(w3c, 364)
{
sc_test364 sc;
sc.init();
sc_test364 sc;
sc.init();
EXPECT_EQ(1, sc.model.cur_state.size());
EXPECT_TRUE(sc.model.In<sc_test364::state_pass>());
}
@@ -399,6 +399,18 @@ TEST(issue_94, 0)
EXPECT_TRUE(sc.model.In<sc_issue_94::state_P1P1S2>());
}

// issue: wrong transition taken
TEST(issue_97, 0)
{
sc_issue_97 sc;
sc.init();
EXPECT_TRUE(sc.model.In<sc_issue_97::state_P1S1S1>());
EXPECT_TRUE(sc.model.In<sc_issue_97::state_P1S2S1>());
sc.dispatch(&sc_issue_97::state::event_ev1);
EXPECT_TRUE(sc.model.In<sc_issue_97::state_P1S1S2>());
EXPECT_TRUE(sc.model.In<sc_issue_97::state_P1S2S1>());
}

TEST(eventless, 0)
{
sc_eventless sc;
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0">
<parallel id="P1">
<state id="P1S1">
<state id="P1S1S1">
<transition type="external" event="ev1" target="P1S1S2"/>
</state>
<state id="P1S1S2">
</state>
</state>
<state id="P1S2">
<state id="P1S2S1">
</state>
</state>
<transition type="external" event="ev1" target="Final_1"/>
</parallel>
<final id="Final_1">
</final>
</scxml>

@@ -15,7 +15,7 @@
#** along with this program. If not, see <http://www.gnu.org/licenses/>.
#*************************************************************************

CPPFLAGS := -Wall -Wpedantic -O2 -MD -MP
CPPFLAGS := -Wall -Wpedantic -Wold-style-cast -Wshadow -O2 -MD -MP
CPPFLAGS += -std=c++17 -isystem gtest-1.8.1/include -pthread

test.objs := test.o
@@ -1,25 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" name="stringevents" qt:editorversion="4.5.2" xmlns:qt="http://www.qt.io/2015/02/scxml-ext">
<state id="State_1">
<qt:editorinfo scenegeometry="136.57;86.63;76.57;36.63;120;100" geometry="136.57;86.63;-60;-50;120;100"/>
<transition type="external" event="ev1" target="State_2"/>
</state>
<state id="State_2">
<qt:editorinfo scenegeometry="136.57;306.77;76.57;256.77;120;100" geometry="136.57;306.77;-60;-50;120;100"/>
<transition type="external" event="ev2.1" target="State_3"/>
<transition type="external" event="ev2" target="ErrorState"/>
</state>
<state id="ErrorState">
<qt:editorinfo scenegeometry="434.17;306.77;374.17;256.77;120;100" geometry="434.17;306.77;-60;-50;120;100"/>
<transition type="external" target="Final_3"/>
<onentry>
<log expr="Error state entered"/>
</onentry>
</state>
<state id="State_3">
<qt:editorinfo scenegeometry="136.57;537.11;76.57;487.11;120;100" geometry="136.57;537.11;-60;-50;120;100"/>
</state>
<final id="Final_3">
<qt:editorinfo scenegeometry="434.17;537.11;414.17;517.11;40;40" geometry="434.17;537.11;-20;-20;40;40"/>
</final>
</scxml>
@@ -22,6 +22,7 @@
#include "issue_72.h"
#include "issue_88.h"
#include "issue_94.h"
#include "issue_97.h"
#include "eventless.h"
#include "stringevents.h"

@@ -24,6 +24,7 @@
#include "issue_72_t.h"
#include "issue_88_t.h"
#include "issue_94_t.h"
#include "issue_97_t.h"
#include "eventless_t.h"
#include "stringevents_t.h"

0 comments on commit b73c7e7

Please sign in to comment.
You can’t perform that action at this time.