Skip to content

Commit

Permalink
Add debug output on failing assertions
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Feb 9, 2022
1 parent 354a04a commit 0038e2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/Filesystem_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,8 @@ TEST_F(FilesystemTest, append)
EXPECT_EQ(path, "base\\before\\after");
#endif

// Make sure that the slashes in the middle of string are not altered.
// This is actually incorrect behavior
path = joinPaths("https://fuel.ignitionrobotics.org", "/models", "box");
#ifndef _WIN32
EXPECT_EQ(path, "https://fuel.ignitionrobotics.org/models/box");
#else
EXPECT_EQ(path, "https://fuel.ignitionrobotics.org\\models\\box");
#endif
}

/////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions src/TempDirectory_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ TEST(TempDirectory, createTempDirectoryEmptyBase)
{
// OS TMPDIR should never be empty
auto tmpDir = ignition::common::tempDirectoryPath();
ASSERT_FALSE(tmpDir.empty());
ASSERT_FALSE(tmpDir.empty()) << tmpDir;

// Create with an empty basename (eg /tmp/XXXXXX)
auto tmp = ignition::common::createTempDirectory("", tmpDir);
ASSERT_FALSE(tmp.empty());
EXPECT_EQ(std::string::npos, tmp.find("foo"));
EXPECT_NE(std::string::npos, tmp.find(tmpDir));
ASSERT_FALSE(tmp.empty()) << tmp;
EXPECT_EQ(std::string::npos, tmp.find("foo")) << tmp;
EXPECT_NE(std::string::npos, tmp.find(tmpDir)) << tmp;
}

/////////////////////////////////////////////////
Expand Down

0 comments on commit 0038e2f

Please sign in to comment.