예제 #1
0
 @Test
 public void testEmptyFor() {
   String input = "for(;;){}";
   CFG cfg = getCFGForCode(input);
   CFGNode node = getNodeByCode(cfg, "INFINITE FOR");
   assertTrue(node instanceof InfiniteForNode);
   assertTrue(cfg.size() == 3);
 }
예제 #2
0
 @Test
 public void testTwoInstructions() {
   String input = "x = 10; y = 20;";
   CFG cfg = getCFGForCode(input);
   assertTrue(cfg.size() == 4);
 }
예제 #3
0
 @Test
 public void testDoNumberOfBlocks() {
   String input = "do{ bar(); }while(foo);";
   CFG cfg = getCFGForCode(input);
   assertTrue(cfg.size() == 4);
 }
예제 #4
0
 @Test
 public void testForNumberOfBlocks() {
   String input = "for(i = 0; i < 10; i ++){ foo(); }";
   CFG cfg = getCFGForCode(input);
   assertTrue(cfg.size() == 6);
 }
예제 #5
0
 @Test
 public void testSingleCallBlockNumber() {
   String input = "foo();";
   CFG cfg = getCFGForCode(input);
   assertTrue(cfg.size() == 3);
 }