Check ostream modifier correctly

This commit is contained in:
Nik Bougalis
2017-02-05 14:42:58 -08:00
committed by Vinnie Falco
parent c82cc218e1
commit 69f95c870b
4 changed files with 2 additions and 6 deletions

View File

@ -2,6 +2,7 @@
* Fix compilation error in non-template class
* Document type-pun in buffer_cat
* Correctly check ostream modifier (/extras)
HTTP

View File

@ -111,7 +111,7 @@ public:
: std::basic_ostream<CharT, Traits>(&buf_)
, buf_(os)
{
if(os.flags() && std::ios::unitbuf)
if(os.flags() & std::ios::unitbuf)
std::unitbuf(*this);
}
};

View File

@ -283,7 +283,6 @@ reporter<_>::
on_log(std::string const& s)
{
os_ << s;
os_.flush();
}
} // detail

View File

@ -352,11 +352,8 @@ public:
{
auto const& name = ss_.str();
if(! name.empty())
{
suite_.log.flush();
suite_.runner_->testcase(name);
}
}
scoped_testcase(suite& self, std::stringstream& ss)
: suite_(self)
@ -394,7 +391,6 @@ suite::testcase_t::operator()(
std::string const& name, abort_t abort)
{
suite_.abort_ = abort == abort_on_fail;
suite_.log.flush();
suite_.runner_->testcase(name);
}