Suppress bogus coverity warnings

This commit is contained in:
vitaut 2015-10-22 05:58:37 -07:00
parent 869ed1ec19
commit b64913b00b
2 changed files with 3 additions and 4 deletions

View File

@ -449,6 +449,7 @@ class BasicArgFormatter : public ArgVisitor<Impl, void> {
std::fill_n(out, spec_.width_ - 1, fill);
out += spec_.width_ - 1;
} else if (spec_.align_ == ALIGN_CENTER) {
// coverity[suspicious_sizeof]
out = writer_.fill_padding(out, spec_.width_, 1, fill);
} else {
std::fill_n(out + 1, spec_.width_ - 1, fill);

View File

@ -40,9 +40,6 @@
using testing::internal::scoped_ptr;
// Marks the argument as sanitized (defined in Coverity model file).
const std::string &sanitize(const std::string &s) { return s; }
namespace {
// Tests that assertion macros evaluate their arguments exactly once.
@ -380,7 +377,8 @@ TEST(OutputRedirectTest, RestoreAndRead) {
std::fprintf(file.get(), "[[[");
OutputRedirect redir(file.get());
std::fprintf(file.get(), "censored");
EXPECT_EQ("censored", sanitize(redir.restore_and_read()));
// coverity[tainted_data]
EXPECT_EQ("censored", redir.restore_and_read());
EXPECT_EQ("", redir.restore_and_read());
std::fprintf(file.get(), "]]]");
file = BufferedFile();