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

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


    assertEquals("b", parameterB.getName());
    assertEquals("int", parameterB.getType().toString());
  }

  public void testForStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { for(;;); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement forStatement = functionFoo.getChild(0);
    assertNotNull(forStatement);
  }
View Full Code Here


    LoopStatement forStatement = functionFoo.getChild(0);
    assertNotNull(forStatement);
  }

  public void testWhileStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { while(true); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement whileStatement = functionFoo.getChild(0);
    assertNotNull(whileStatement);
  }
View Full Code Here

    LoopStatement whileStatement = functionFoo.getChild(0);
    assertNotNull(whileStatement);
  }

  public void testDoStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { do {} while(true); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement doStatement = functionFoo.getChild(0);
    assertNotNull(doStatement);
  }
View Full Code Here

    LoopStatement doStatement = functionFoo.getChild(0);
    assertNotNull(doStatement);
  }

  public void testWhileInForStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { for(;;) while(true); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement forStatement = functionFoo.getChild(0);
    assertNotNull(forStatement);
    LoopStatement whileStatement = forStatement.getChild(0);
    assertNotNull(whileStatement);
  }
View Full Code Here

    LoopStatement whileStatement = forStatement.getChild(0);
    assertNotNull(whileStatement);
  }

  public void testForInDoStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { do for(;;); while(true); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement doStatement = functionFoo.getChild(0);
    assertNotNull(doStatement);
    LoopStatement forStatement = doStatement.getChild(0);
    assertNotNull(forStatement);
  }
View Full Code Here

    LoopStatement forStatement = doStatement.getChild(0);
    assertNotNull(forStatement);
  }

  public void testForInCompoundDoStatement() throws Exception {
    TranslationUnit unit = parse("void foo() { do { for(;;); } while(true); }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement doStatement = functionFoo.getChild(0);
    assertNotNull(doStatement);
    LoopStatement forStatement = doStatement.getChild(0);
    assertNotNull(forStatement);
  }
View Full Code Here

    LoopStatement forStatement = doStatement.getChild(0);
    assertNotNull(forStatement);
  }

  public void testForInSeveralCompoundStatements() throws Exception {
    TranslationUnit unit = parse("void foo() { {{{ for(;;); }}} }");
    FunctionDefinition functionFoo = unit.getChild(0);
    LoopStatement forStatement = functionFoo.getChild(0);
    assertNotNull(forStatement);
  }
View Full Code Here

    LoopStatement forStatement = functionFoo.getChild(0);
    assertNotNull(forStatement);
  }

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

    IfStatement ifStatement = functionFoo.getChild(0);
    assertNotNull(ifStatement);
  }

  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

    ElseStatement elseStatement = functionFoo.getChild(1);
    assertNotNull(elseStatement);
  }

  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

TOP

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

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.