From 69f95c870b13f7ca42f0f9fe2528b9b3859350e6 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Sun, 5 Feb 2017 14:42:58 -0800 Subject: [PATCH] Check ostream modifier correctly --- CHANGELOG.md | 1 + extras/beast/unit_test/dstream.hpp | 2 +- extras/beast/unit_test/reporter.hpp | 1 - extras/beast/unit_test/suite.hpp | 4 ---- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 761b19e0..49c4373e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Fix compilation error in non-template class * Document type-pun in buffer_cat +* Correctly check ostream modifier (/extras) HTTP diff --git a/extras/beast/unit_test/dstream.hpp b/extras/beast/unit_test/dstream.hpp index c62c8060..44eb599b 100644 --- a/extras/beast/unit_test/dstream.hpp +++ b/extras/beast/unit_test/dstream.hpp @@ -111,7 +111,7 @@ public: : std::basic_ostream(&buf_) , buf_(os) { - if(os.flags() && std::ios::unitbuf) + if(os.flags() & std::ios::unitbuf) std::unitbuf(*this); } }; diff --git a/extras/beast/unit_test/reporter.hpp b/extras/beast/unit_test/reporter.hpp index 771a76df..cb2e3317 100644 --- a/extras/beast/unit_test/reporter.hpp +++ b/extras/beast/unit_test/reporter.hpp @@ -283,7 +283,6 @@ reporter<_>:: on_log(std::string const& s) { os_ << s; - os_.flush(); } } // detail diff --git a/extras/beast/unit_test/suite.hpp b/extras/beast/unit_test/suite.hpp index 721f49a4..1120daf4 100644 --- a/extras/beast/unit_test/suite.hpp +++ b/extras/beast/unit_test/suite.hpp @@ -352,10 +352,7 @@ public: { auto const& name = ss_.str(); if(! name.empty()) - { - suite_.log.flush(); suite_.runner_->testcase(name); - } } scoped_testcase(suite& self, std::stringstream& ss) @@ -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); }