functionFoo.accept(analyzer);
assertEquals(3, analyzer.getScore());
}
public void testSwitchWithDefault() throws Exception {
TranslationUnit unit = parse(
"void foo() { " +
" int a = 0; " +
" switch(a) { " +
" case 0: " +
" a = 0; " +
" break; " +
" default: " +
" a = 3; " +
" } " +
"} "
);
FunctionDefinition functionFoo = unit.getChild(0);
functionFoo.accept(analyzer);
assertEquals(2, analyzer.getScore());
}