diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-09-02 12:37:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-09-02 12:37:54 +0100 |
| commit | 73d54683d5e034b56e2edca968b477bb1b3a9603 (patch) | |
| tree | 3ed1000687539128712147b312c9123a516db947 | |
| parent | 0e31bf38638a8f2c0b08af01e4214c21452f81f2 (diff) | |
Add another unit test.
| -rw-r--r-- | test/colour_conversion_test.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc index da6600f08..eb4b79ef8 100644 --- a/test/colour_conversion_test.cc +++ b/test/colour_conversion_test.cc @@ -22,10 +22,12 @@ */ #include "lib/colour_conversion.h" +#include "lib/film.h" #include <dcp/colour_matrix.h> #include <dcp/gamma_transfer_function.h> #include <libxml++/libxml++.h> #include <boost/test/unit_test.hpp> +#include <boost/foreach.hpp> using std::cout; using boost::shared_ptr; @@ -97,3 +99,16 @@ BOOST_AUTO_TEST_CASE (colour_conversion_test3) "</Test>\n" ); } + +/** Test a round trip via the XML representation */ +BOOST_AUTO_TEST_CASE (colour_conversion_test4) +{ + BOOST_FOREACH (PresetColourConversion const & i, PresetColourConversion::all ()) { + xmlpp::Document out; + xmlpp::Element* out_root = out.create_root_node ("Test"); + i.conversion.as_xml (out_root); + shared_ptr<cxml::Document> in (new cxml::Document ("Test")); + in->read_string (out.write_to_string ("UTF-8")); + BOOST_CHECK (ColourConversion::from_xml (in, Film::current_state_version).get () == i.conversion); + } +} |
