From 23e84472b2ffd984f744f0c5b1b32707639713bb Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 21 Oct 2015 08:45:48 -0700 Subject: [PATCH] Hook Coverity model file --- test/gtest-extra-test.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index 4e5db1d5..2be57b24 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -40,6 +40,9 @@ using testing::internal::scoped_ptr; +// Marks the argument as sanitized (defined in Coverity model file). +const std::string &sanitize(const std::string &) {} + namespace { // Tests that assertion macros evaluate their arguments exactly once. @@ -377,7 +380,7 @@ TEST(OutputRedirectTest, RestoreAndRead) { std::fprintf(file.get(), "[[["); OutputRedirect redir(file.get()); std::fprintf(file.get(), "censored"); - EXPECT_EQ("censored", redir.restore_and_read()); + EXPECT_EQ("censored", sanitize(redir.restore_and_read())); EXPECT_EQ("", redir.restore_and_read()); std::fprintf(file.get(), "]]]"); file = BufferedFile();