Package com.google.test.metric.cpp.dom

Examples of com.google.test.metric.cpp.dom.ElseStatement


    finished();
  }

  @Override
  public void beginElseStatement() {
    Node node = new ElseStatement();
    parent.addChild(node);
    pushBuilder(new StatementBuilder(node));
  }
View Full Code Here


  public void testIfElseStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { if (true); else; }");
    FunctionDefinition functionFoo = unit.getChild(0);
    IfStatement ifStatement = functionFoo.getChild(0);
    assertNotNull(ifStatement);
    ElseStatement elseStatement = functionFoo.getChild(1);
    assertNotNull(elseStatement);
  }
View Full Code Here

  public void testCompoundIfElseStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { if (true) {} else {} }");
    FunctionDefinition functionFoo = unit.getChild(0);
    IfStatement ifStatement = functionFoo.getChild(0);
    assertNotNull(ifStatement);
    ElseStatement elseStatement = functionFoo.getChild(1);
    assertNotNull(elseStatement);
  }
View Full Code Here

    TranslationUnit unit = parse("void foo() { if (true) { for(;;); } else { while(true); } }");
    FunctionDefinition functionFoo = unit.getChild(0);
    IfStatement ifStatement = functionFoo.getChild(0);
    LoopStatement forStatement = ifStatement.getChild(0);
    assertNotNull(forStatement);
    ElseStatement elseStatement = functionFoo.getChild(1);
    LoopStatement whileStatement = elseStatement.getChild(0);
    assertNotNull(whileStatement);
  }
View Full Code Here

TOP

Related Classes of com.google.test.metric.cpp.dom.ElseStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.