aboutsummaryrefslogtreecommitdiff
path: root/src/relooper/test.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-13 12:37:34 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-13 12:37:34 -0800
commitd1f37af9792b048f7ef98140d067ba129a97c565 (patch)
tree840bf755de2b5530e392d13d15918ceec9978eaa /src/relooper/test.cpp
parentec3eba770983ad300ca958db5764206924452b0b (diff)
allow relooper to manager its own output buffer, to avoid fixed output limits1.8.7
Diffstat (limited to 'src/relooper/test.cpp')
-rw-r--r--src/relooper/test.cpp28
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);
+ }
}