diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-15 17:01:19 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-15 17:01:19 -0800 |
commit | c42b937808924f6b922b29d2e0fd1fe1d1b0411c (patch) | |
tree | 4027d435b6638a7e72b9519990298fb9314ecc96 /src/relooper/test.cpp | |
parent | 8478d6aee54d6c52de16d8c58309534afbf5bf9e (diff) | |
parent | e5ccf17e84e7a5102bf9e05ffef01e6672b4c15a (diff) |
Merge branch 'incoming'
Diffstat (limited to 'src/relooper/test.cpp')
-rw-r--r-- | src/relooper/test.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/relooper/test.cpp b/src/relooper/test.cpp index 773f6ee4..b4ce669c 100644 --- a/src/relooper/test.cpp +++ b/src/relooper/test.cpp @@ -286,5 +286,33 @@ int main() { puts(buffer); } + + if (1) { + Relooper::MakeOutputBuffer(10); + + printf("\n\n-- If pattern, emulated, using MakeOutputBuffer --\n\n"); + + Block *b_a = new Block("// block A\n", NULL); + Block *b_b = new Block("// block B\n", "b_check()"); + Block *b_c = new Block("// block C\n", NULL); + + b_a->AddBranchTo(b_b, "check == 10", "atob();"); + b_a->AddBranchTo(b_c, NULL, "atoc();"); + + b_b->AddBranchTo(b_c, "case 17:", "btoc();"); + b_b->AddBranchTo(b_a, NULL, NULL); + + Relooper r; + r.SetEmulate(true); + r.AddBlock(b_a); + r.AddBlock(b_b); + r.AddBlock(b_c); + + r.Calculate(b_a); + printf("\n\n", "the_var"); + r.Render(); + + puts(buffer); + } } |