Skip to content

Commit

Permalink
add extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varunagrawal committed Aug 23, 2022
1 parent aa52b39 commit df64982
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gtsam/hybrid/tests/testHybridLookupDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,4 @@ int main() {
TestResult tr;
return TestRegistry::runAllTests(tr);
}
/* ************************************************************************* */
/* ************************************************************************* */
15 changes: 15 additions & 0 deletions gtsam/hybrid/tests/testHybridNonlinearFactorGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/****************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion gtsam/hybrid/tests/testHybridValues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ int main() {
TestResult tr;
return TestRegistry::runAllTests(tr);
}
/* ************************************************************************* */
/* ************************************************************************* */

0 comments on commit df64982

Please sign in to comment.