fix test xml file path

release/4.3a0
Gerry Chen 2022-01-31 01:08:47 -05:00
parent 1a427cd96c
commit 6653d666ef
No known key found for this signature in database
GPG Key ID: E9845092D3A57286
1 changed files with 3 additions and 8 deletions

View File

@ -142,15 +142,10 @@ TEST(Serialization, NoiseModelFactor1_backwards_compatibility) {
EXPECT(assert_equal(factor, factor_deserialized_str)); EXPECT(assert_equal(factor, factor_deserialized_str));
// XML // XML
std::string expected_xml;
{ // read from file
std::ifstream f("priorFactor.xml");
std::stringstream buffer;
buffer << f.rdbuf();
expected_xml = buffer.str();
}
PriorFactor<Pose3> factor_deserialized_xml = PriorFactor<Pose3>(); PriorFactor<Pose3> factor_deserialized_xml = PriorFactor<Pose3>();
deserializeFromXMLFile("priorFactor.xml", factor_deserialized_xml); deserializeFromXMLFile(GTSAM_SOURCE_TREE_DATASET_DIR
"/../../gtsam/nonlinear/tests/priorFactor.xml",
factor_deserialized_xml);
EXPECT(assert_equal(factor, factor_deserialized_xml)); EXPECT(assert_equal(factor, factor_deserialized_xml));
} }