diff options
Diffstat (limited to 'test/trans.d/case/zlen1_c.rl')
-rw-r--r-- | test/trans.d/case/zlen1_c.rl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/trans.d/case/zlen1_c.rl b/test/trans.d/case/zlen1_c.rl new file mode 100644 index 00000000..fbeda2a0 --- /dev/null +++ b/test/trans.d/case/zlen1_c.rl @@ -0,0 +1,61 @@ +/* + * @LANG: c + * @GENERATED: true + */ + +#include <string.h> +#include <stdio.h> + + + + +%%{ + machine zlen1; + main := zlen; +}%% + + + +%% write data; +int cs; +int blen; +char buffer[1024]; + +void init() +{ + %% write init; +} + +void exec( char *data, int len ) +{ + char *p = data; + char *pe = data + len; + %% write exec; +} + +void finish( ) +{ + if ( cs >= zlen1_first_final ) + printf( "ACCEPT\n" ); + else + printf( "FAIL\n" ); +} + +char *inp[] = { +"", +"x", +}; + +int inplen = 2; + +int main( ) +{ + int i; + for ( i = 0; i < inplen; i++ ) { + init(); + exec( inp[i], strlen(inp[i]) ); + finish(); + } + return 0; +} + |