diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-07-22 09:20:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-07-22 09:20:58 +0100 |
| commit | 455475575bcfa30aa60a377235bfaf2fd7bc2da7 (patch) | |
| tree | 691c69e3e25722a4fa6ffe632179243907be8240 /test | |
| parent | 1eb9ba017214698de3fd41de5291604b4fe839c5 (diff) | |
Use locked_sstream. Replace once parse_stream with parse_memory.
Diffstat (limited to 'test')
| -rw-r--r-- | test/colour_test.cc | 5 | ||||
| -rw-r--r-- | test/kdm_test.cc | 9 | ||||
| -rw-r--r-- | test/test.cc | 4 |
3 files changed, 7 insertions, 11 deletions
diff --git a/test/colour_test.cc b/test/colour_test.cc index a99b5b7e..d39c888d 100644 --- a/test/colour_test.cc +++ b/test/colour_test.cc @@ -19,10 +19,9 @@ #include "util.h" #include "exceptions.h" +#include <locked_sstream.h> #include <boost/test/unit_test.hpp> -using std::stringstream; - /** Check that dcp::Colour works */ BOOST_AUTO_TEST_CASE (colour) { @@ -58,7 +57,7 @@ BOOST_AUTO_TEST_CASE (colour) BOOST_CHECK_THROW (dcp::Colour ("001234"), dcp::XMLError); - stringstream s; + locked_stringstream s; s << c; BOOST_CHECK_EQUAL (s.str(), "(255, 0, 0)"); } diff --git a/test/kdm_test.cc b/test/kdm_test.cc index ee52ad8e..82701d96 100644 --- a/test/kdm_test.cc +++ b/test/kdm_test.cc @@ -17,14 +17,13 @@ along with libdcp. If not, see <http://www.gnu.org/licenses/>. */ -#include <boost/test/unit_test.hpp> -#include <libxml++/libxml++.h> #include "encrypted_kdm.h" #include "decrypted_kdm.h" #include "util.h" +#include <libxml++/libxml++.h> +#include <boost/test/unit_test.hpp> using std::list; -using std::stringstream; using boost::shared_ptr; /** Check reading and decryption of a KDM */ @@ -58,9 +57,7 @@ BOOST_AUTO_TEST_CASE (kdm_passthrough_test) ); shared_ptr<xmlpp::DomParser> parser (new xmlpp::DomParser ()); - stringstream s; - s << kdm.as_xml (); - parser->parse_stream (s); + parser->parse_memory (kdm.as_xml ()); parser->get_document()->write_to_file_formatted ("build/kdm.xml", "UTF-8"); int const r = system ( "xmldiff -c test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml build/kdm.xml" diff --git a/test/test.cc b/test/test.cc index 0e7ad511..c17f1506 100644 --- a/test/test.cc +++ b/test/test.cc @@ -21,13 +21,13 @@ #define BOOST_TEST_MODULE libdcp_test #include "util.h" #include "test.h" +#include <locked_sstream.h> #include <libxml++/libxml++.h> #include <boost/test/unit_test.hpp> #include <cstdio> using std::string; using std::min; -using std::stringstream; using std::list; boost::filesystem::path private_test; @@ -123,7 +123,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) uint8_t* ref_buffer = new uint8_t[buffer_size]; uint8_t* check_buffer = new uint8_t[buffer_size]; - stringstream error; + locked_stringstream error; error << "File " << check.string() << " differs from reference " << ref.string(); while (N) { |
