MCPcopy Create free account
hub / github.com/UZ-SLAMLab/ORB_SLAM3 / testFormatString

Function testFormatString

Thirdparty/Sophus/test/core/test_common.cpp:10–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace {
9
10bool testFormatString() {
11 bool passed = true;
12 SOPHUS_TEST_EQUAL(passed, details::FormatString(), std::string());
13 std::string test_str = "Hello World!";
14 SOPHUS_TEST_EQUAL(passed, details::FormatString(test_str.c_str()), test_str);
15 SOPHUS_TEST_EQUAL(passed, details::FormatString("Number: %", 5),
16 std::string("Number: 5"));
17 SOPHUS_TEST_EQUAL(passed,
18 details::FormatString("Real: % msg %", 1.5, test_str),
19 std::string("Real: 1.5 msg Hello World!"));
20 SOPHUS_TEST_EQUAL(passed,
21 details::FormatString(
22 "vec: %", Eigen::Vector3f(0.f, 1.f, 1.5f).transpose()),
23 std::string("vec: 0 1 1.5"));
24 SOPHUS_TEST_EQUAL(
25 passed, details::FormatString("Number: %", 1, 2),
26 std::string("Number: 1\nFormat-Warning: There are 1 args unused."));
27 return passed;
28}
29
30bool testSmokeDetails() {
31 bool passed = true;

Callers 1

runAllFunction · 0.85

Calls 2

FormatStringFunction · 0.85
transposeMethod · 0.80

Tested by

no test coverage detected