~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to src/relooper/test.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
 
259
259
    puts(buffer);
260
260
  }
 
261
 
 
262
  if (1) {
 
263
    Relooper::SetOutputBuffer(buffer, sizeof(buffer));
 
264
 
 
265
    printf("\n\n-- If pattern, emulated --\n\n", "the_var");
 
266
 
 
267
    Block *b_a = new Block("// block A\n", NULL);
 
268
    Block *b_b = new Block("// block B\n", "b_check()");
 
269
    Block *b_c = new Block("// block C\n", NULL);
 
270
 
 
271
    b_a->AddBranchTo(b_b, "check == 10", "atob();");
 
272
    b_a->AddBranchTo(b_c, NULL, "atoc();");
 
273
 
 
274
    b_b->AddBranchTo(b_c, "case 17:", "btoc();");
 
275
    b_b->AddBranchTo(b_a, NULL, NULL);
 
276
 
 
277
    Relooper r;
 
278
    r.SetEmulate(true);
 
279
    r.AddBlock(b_a);
 
280
    r.AddBlock(b_b);
 
281
    r.AddBlock(b_c);
 
282
 
 
283
    r.Calculate(b_a);
 
284
    printf("\n\n", "the_var");
 
285
    r.Render();
 
286
 
 
287
    puts(buffer);
 
288
  }
 
289
 
 
290
  if (1) {
 
291
    Relooper::MakeOutputBuffer(10);
 
292
 
 
293
    printf("\n\n-- If pattern, emulated, using MakeOutputBuffer --\n\n");
 
294
 
 
295
    Block *b_a = new Block("// block A\n", NULL);
 
296
    Block *b_b = new Block("// block B\n", "b_check()");
 
297
    Block *b_c = new Block("// block C\n", NULL);
 
298
 
 
299
    b_a->AddBranchTo(b_b, "check == 10", "atob();");
 
300
    b_a->AddBranchTo(b_c, NULL, "atoc();");
 
301
 
 
302
    b_b->AddBranchTo(b_c, "case 17:", "btoc();");
 
303
    b_b->AddBranchTo(b_a, NULL, NULL);
 
304
 
 
305
    Relooper r;
 
306
    r.SetEmulate(true);
 
307
    r.AddBlock(b_a);
 
308
    r.AddBlock(b_b);
 
309
    r.AddBlock(b_c);
 
310
 
 
311
    r.Calculate(b_a);
 
312
    printf("\n\n", "the_var");
 
313
    r.Render();
 
314
 
 
315
    puts(buffer);
 
316
  }
261
317
}
262
318