use std::replace

release/4.3a0
kartik arcot 2023-01-23 10:01:18 -08:00 committed by Frank Dellaert
parent fd38c08287
commit 2828879d02
1 changed files with 2 additions and 3 deletions

View File

@ -22,8 +22,6 @@
#include <gtsam/inference/Symbol.h>
#include <gtsam/base/TestableAssertions.h>
#include <boost/algorithm/string.hpp>
#include <CppUnitLite/TestHarness.h>
#include <iostream>
@ -38,7 +36,8 @@ TEST(dataSet, findExampleDataFile) {
const string expected_end = "examples/Data/example.graph";
const string actual = findExampleDataFile("example");
string actual_end = actual.substr(actual.size() - expected_end.size(), expected_end.size());
boost::replace_all(actual_end, "\\", "/"); // Convert directory separators to forward-slash
// replace all ocurrences of \\ with / use stl
std::replace(actual_end.begin(), actual_end.end(), '\\', '/');
EXPECT(assert_equal(expected_end, actual_end));
}