Skip to content

Commit

Permalink
Fix ogre_log test (#2954)
Browse files Browse the repository at this point in the history
* Add debugging output to ogre_log test
* ogre_log test: ignore GLX extension line

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Apr 14, 2021
1 parent 32c6869 commit 6116553
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/integration/ogre_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,20 @@ TEST_F(OgreLog, LogError)
if (line.find(" GL_EXTENSIONS =") < 12)
continue;

EXPECT_EQ(line.find("Error"), std::string::npos);
EXPECT_EQ(line.find("error"), std::string::npos);
EXPECT_EQ(line.find("ERROR"), std::string::npos);
// A GLX extension may have the word "error" in its name. For example:
// GLX_ARB_create_context_no_error.
// We will skip the line that lists all the extensions. This line starts
// with a date, so we just check that "Supported GLX extensions:" is
// toward the beginning.
// False positive cppcheck
// https://sourceforge.net/p/cppcheck/discussion/general/thread/0c113d65/
// cppcheck-suppress stlIfStrFind
if (line.find(" Supported GLX extensions: ") < 12)
continue;

EXPECT_EQ(line.find("Error"), std::string::npos) << line;
EXPECT_EQ(line.find("error"), std::string::npos) << line;
EXPECT_EQ(line.find("ERROR"), std::string::npos) << line;
}
}

Expand Down

0 comments on commit 6116553

Please sign in to comment.