From f5e136ca4c4f757a3b7fd39a120dc848ea5d47bc Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Thu, 3 Apr 2014 19:52:00 +0000 Subject: QPID-5659: Fixes to compile with C++11 (needed to compile with clang on FreeBSD 10) - shared_ptr no longer has a default conversion to bool. - Change in default destructor semantics: by default destructors are now not allowed to throw exceptions. - stringstream no longer has a default conversion to string. git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/0.28@1584361 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp | 2 +- qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp | 4 ++-- qpid/cpp/src/tests/msg_group_test.cpp | 3 +-- qpid/cpp/src/tests/qpid-receive.cpp | 3 +-- qpid/cpp/src/tests/qpid-send.cpp | 5 ++--- 5 files changed, 7 insertions(+), 10 deletions(-) (limited to 'qpid/cpp/src/tests') diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp index 842ea5c9ef..b55d5ff8ef 100644 --- a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp +++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jdir.cpp @@ -76,7 +76,7 @@ void create_jdat_file(const char* dirname, const char* base_filename, u_int32_t file_hdr fh(RHM_JDAT_FILE_MAGIC, RHM_JDAT_VERSION, 0, first_rid, fid, 0x200, true); ofstream of(fn.str().c_str(), ofstream::out | ofstream::trunc); if (!of.good()) - BOOST_FAIL("Unable to open journal data file " << fn << " for writing."); + BOOST_FAIL("Unable to open journal data file " << fn.str() << " for writing."); of.write((const char*)&fh, sizeof(file_hdr)); of.close(); } diff --git a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp index c6377c2287..f239139306 100644 --- a/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp +++ b/qpid/cpp/src/tests/legacystore/jrnl/_ut_jinf.cpp @@ -360,7 +360,7 @@ QPID_AUTO_TEST_CASE(analyze_owi_in_non_ae_journal) try { ji.analyze(); - BOOST_FAIL("Failed to detect irregular OWI flag in non-ae journal file \"" << fn << "\""); + BOOST_FAIL("Failed to detect irregular OWI flag in non-ae journal file \"" << fn.str() << "\""); } catch (const jexception& e) {} // ignore - expected @@ -389,7 +389,7 @@ QPID_AUTO_TEST_CASE(analyze_owi_in_ae_min_size_journal) try { ji.analyze(); - BOOST_FAIL("Failed to detect irregular OWI flag in min-sized ae journal file \"" << fn << "\""); + BOOST_FAIL("Failed to detect irregular OWI flag in min-sized ae journal file \"" << fn.str() << "\""); } catch (const jexception& e) {} // ignore - expected diff --git a/qpid/cpp/src/tests/msg_group_test.cpp b/qpid/cpp/src/tests/msg_group_test.cpp index 4f54e3ee53..ca87197ff3 100644 --- a/qpid/cpp/src/tests/msg_group_test.cpp +++ b/qpid/cpp/src/tests/msg_group_test.cpp @@ -130,8 +130,7 @@ struct Options : public qpid::Options if (messages == 0) throw qpid::Exception("The message count cannot be zero."); qpid::log::Logger::instance().configure(log); if (help) { - std::ostringstream msg; - std::cout << msg << *this << std::endl << std::endl + std::cout << *this << std::endl << std::endl << "Verifies the behavior of grouped messages." << std::endl; return false; } else { diff --git a/qpid/cpp/src/tests/qpid-receive.cpp b/qpid/cpp/src/tests/qpid-receive.cpp index ab26d3d9b5..fb1db05d99 100644 --- a/qpid/cpp/src/tests/qpid-receive.cpp +++ b/qpid/cpp/src/tests/qpid-receive.cpp @@ -136,8 +136,7 @@ struct Options : public qpid::Options if (address.empty()) throw qpid::Exception("Address must be specified!"); qpid::log::Logger::instance().configure(log); if (help) { - std::ostringstream msg; - std::cout << msg << *this << std::endl << std::endl + std::cout << *this << std::endl << std::endl << "Drains messages from the specified address" << std::endl; return false; } else { diff --git a/qpid/cpp/src/tests/qpid-send.cpp b/qpid/cpp/src/tests/qpid-send.cpp index 5414abb892..78702f7a85 100644 --- a/qpid/cpp/src/tests/qpid-send.cpp +++ b/qpid/cpp/src/tests/qpid-send.cpp @@ -165,8 +165,7 @@ struct Options : public qpid::Options if (address.empty()) throw qpid::Exception("Address must be specified!"); qpid::log::Logger::instance().configure(log); if (help) { - std::ostringstream msg; - std::cout << msg << *this << std::endl << std::endl + std::cout << *this << std::endl << std::endl << "Drains messages from the specified address" << std::endl; return false; } else { @@ -241,7 +240,7 @@ class GetlineContentGenerator : public ContentGenerator { public: virtual bool setContent(Message& msg) { string content; - bool got = getline(std::cin, content); + bool got = !!getline(std::cin, content); if (got) msg.setContentObject(content); return got; } -- cgit v1.2.1