diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-08-18 22:11:59 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-08-18 22:11:59 +0100 |
| commit | b89cc774a89867caa97db4b082655569c7d69432 (patch) | |
| tree | 7a2381e431ac37c1e23752ad5970ded4dd99f56a /test | |
| parent | e4b30a67b690755a3cd44678bd0671f06af8a36e (diff) | |
Add colour conversion identifier to video identifier.
Diffstat (limited to 'test')
| -rw-r--r-- | test/colour_conversion_test.cc | 34 | ||||
| -rw-r--r-- | test/wscript | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc new file mode 100644 index 000000000..3e90d542a --- /dev/null +++ b/test/colour_conversion_test.cc @@ -0,0 +1,34 @@ +/* + Copyright (C) 2013 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <boost/test/unit_test.hpp> +#include <libdcp/colour_matrix.h> +#include "lib/colour_conversion.h" + +using std::cout; + +/* Basic test of identifier() for ColourConversion (i.e. a hash of the numbers) */ +BOOST_AUTO_TEST_CASE (colour_conversion_test) +{ + ColourConversion A (2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6); + ColourConversion B (2.4, false, libdcp::colour_matrix::srgb_to_xyz, 2.6); + + BOOST_CHECK_EQUAL (A.identifier(), "246ff9b7dc32c0488948a32a713924b3"); + BOOST_CHECK_EQUAL (B.identifier(), "a8d1da30f96a121d8db06a03409758b3"); +} diff --git a/test/wscript b/test/wscript index 8cc50a683..7c7aee733 100644 --- a/test/wscript +++ b/test/wscript @@ -16,6 +16,7 @@ def build(bld): obj.use = 'libdcpomatic' obj.source = """ test.cc + colour_conversion_test.cc audio_delay_test.cc silence_padding_test.cc audio_merger_test.cc @@ -40,5 +41,6 @@ def build(bld): image_test.cc 4k_test.cc """ + obj.target = 'unit-tests' obj.install_path = '' |
