diff options
author | Stefan Radomski <sradomski@mintwerk.de> | 2016-02-29 22:32:08 (GMT) |
---|---|---|
committer | Stefan Radomski <sradomski@mintwerk.de> | 2016-02-29 22:32:08 (GMT) |
commit | 1bdf058cf07cfd53885c81af4c0c943d3baac4c6 (patch) | |
tree | d66e529bf6a4315966f6b560c16f3d084b887f2e /test/src/test-c-inline.c | |
parent | 938bc217b59c6f0a23f7e27baf897cdd9890ae98 (diff) | |
download | uscxml-1bdf058cf07cfd53885c81af4c0c943d3baac4c6.zip uscxml-1bdf058cf07cfd53885c81af4c0c943d3baac4c6.tar.gz uscxml-1bdf058cf07cfd53885c81af4c0c943d3baac4c6.tar.bz2 |
More work on VHDL
Diffstat (limited to 'test/src/test-c-inline.c')
-rw-r--r-- | test/src/test-c-inline.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/src/test-c-inline.c b/test/src/test-c-inline.c index a4b237c..659fcdf 100644 --- a/test/src/test-c-inline.c +++ b/test/src/test-c-inline.c @@ -10,10 +10,16 @@ /** INLINE SCXML BEGIN <scxml name="test-inline" datamodel="native"> <state id="foo"> + <transition target="done" cond="UD->foo == 3" /> <onentry> enteredFoo(); </onentry> </state> + <final id="done"> + <onentry> + enteredDone(); + </onentry> + </final> </scxml> INLINE SCXML END */ @@ -24,15 +30,28 @@ void enteredFoo() { printf("Entered Foo!\n"); } +void enteredDone() { + printf("Entered Done!\n"); +} + +struct userData { + int foo; +}; + +#define UD ((struct userData*)ctx->user_data) #include "test-c-inline.c.scxml.c" + int main(int argc, char** argv) { - uscxml_ctx ctx; + struct userData ud; + uscxml_ctx ctx; int err = USCXML_ERR_OK; - + memset(&ctx, 0, sizeof(uscxml_ctx)); ctx.machine = &USCXML_MACHINE_TEST_INLINE; - + ctx.user_data = &ud; + ud.foo = 3; + while(err != USCXML_ERR_DONE) { err = uscxml_step(&ctx); } |