add extra tests

release/4.3a0
Varun Agrawal 2022-08-23 12:17:42 -04:00
parent aa52b39d9b
commit df64982d72
3 changed files with 17 additions and 2 deletions

View File

@ -269,4 +269,4 @@ int main() {
TestResult tr;
return TestRegistry::runAllTests(tr);
}
/* ************************************************************************* */
/* ************************************************************************* */

View File

@ -188,7 +188,22 @@ TEST(HybridFactorGraph, PushBack) {
ghfg = HybridGaussianFactorGraph();
ghfg.push_back(dcFactor);
HybridGaussianFactorGraph hgfg2;
hgfg2.push_back(ghfg.begin(), ghfg.end());
EXPECT_LONGS_EQUAL(ghfg.size(), 1);
HybridNonlinearFactorGraph hnfg;
NonlinearFactorGraph factors;
auto noise = noiseModel::Isotropic::Sigma(3, 1.0);
factors.emplace_shared<PriorFactor<Pose2>>(0, Pose2(0, 0, 0), noise);
factors.emplace_shared<PriorFactor<Pose2>>(1, Pose2(1, 0, 0), noise);
factors.emplace_shared<PriorFactor<Pose2>>(2, Pose2(2, 0, 0), noise);
// TODO(Varun) This does not currently work. It should work once HybridFactor
// becomes a base class of NonlinearFactor.
// hnfg.push_back(factors.begin(), factors.end());
// EXPECT_LONGS_EQUAL(3, hnfg.size());
}
/****************************************************************************

View File

@ -55,4 +55,4 @@ int main() {
TestResult tr;
return TestRegistry::runAllTests(tr);
}
/* ************************************************************************* */
/* ************************************************************************* */