Code never executed in ErrorTermTests
Closed this issue · 1 comments
simone-fontana commented
ErrorTermTests.cpp seems to have a piece of code that never gets executed:
using namespace aslam::backend;
int D = 4;
int E = 6;
std::vector<DesignVariable*> dvs;
std::vector<ErrorTerm*> errs;
try {
std::vector<int> blocks;
int block = 0;
for (size_t i = 0; i < errs.size(); ++i) {
block += errs[i]->dimension();
blocks.push_back(block);
boost::shared_ptr<GemanMcClureMEstimator> me(new GemanMcClureMEstimator(errs[i]->getRawSquaredError()));
}
errs is of size 0, so the for-loop is never executed. I just noticed it while adding a test, I don't know whether it has any effect on the result of the test.
HannesSommer commented
You mean this :
aslam_optimizer/aslam_backend/test/ErrorTermTests.cpp
Lines 15 to 19 in 1dd9ef5