Cov: instrument correctly case exp 07/17407/2
Calixte DENIZET [Wed, 28 Oct 2015 11:56:18 +0000 (12:56 +0100)]
Change-Id: I4f6928e124fc14fe76bf91a620d71fa0ac21182a

scilab/modules/coverage/src/cpp/InstrumentVisitor.cpp

index dcef1c4..d3f65cd 100644 (file)
@@ -93,6 +93,7 @@ void InstrumentVisitor::visit(ast::SelectExp & e)
 void InstrumentVisitor::visit(ast::CaseExp & e)
 {
     cover.add(macro, e.getTest());
+    ++instrCounts;
     e.getBody()->accept(*this);
 }
 
@@ -117,7 +118,7 @@ void InstrumentVisitor::visit(ast::FunctionDec & e)
         }
 
         pMacro = new types::Macro(e.getSymbol().getName(), *pVarList, *pRetList, static_cast<ast::SeqExp &>(e.getBody()), L"script");
-       pMacro->setLines(e.getLocation().first_line, e.getLocation().last_line);
+        pMacro->setLines(e.getLocation().first_line, e.getLocation().last_line);
         //pMacro->setFirstLine(e.getLocation().first_line);
         e.setMacro(pMacro);
     }