Skip to content

Commit

Permalink
Windows does not output the same values as linux and macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
felix642 committed Nov 29, 2023
1 parent fadbd91 commit ce50030
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions test/std-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,11 @@ TEST(std_test, thread_id) {

#ifdef __cpp_lib_source_location
TEST(std_test, source_location) {
using testing::EndsWith;
std::source_location loc = std::source_location::current();
// We don't know the full path of this file so we only check the end of the
// path.
#ifdef _WIN32
EXPECT_THAT(fmt::format("{}", loc),
EndsWith("std-test.cc:68:52: TestBody"));
#else // Linux or macOS
EXPECT_THAT(fmt::format("{}", loc),
EndsWith("std-test.cc:68:59: virtual void "
"std_test_source_location_Test::TestBody()"));
#endif
EXPECT_EQ(fmt::format("{}", loc), std::string(loc.file_name()) + ":" +
std::to_string(loc.line()) + ":" +
std::to_string(loc.column()) + ": " +
loc.function_name());
}
#endif

Expand Down

0 comments on commit ce50030

Please sign in to comment.