| 8 | namespace { |
| 9 | |
| 10 | bool 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 | |
| 30 | bool testSmokeDetails() { |
| 31 | bool passed = true; |
no test coverage detected