diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-03 22:31:56 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-03 22:31:56 +0000 |
| commit | 7fb85beb1e4b655da0463d7d9c95b1181f5a6f00 (patch) | |
| tree | 676b6ad7889939cabaf1f45eafc003c2130b8e0d /test | |
| parent | 9655ed4740f08899698052f232256fcf7b77c58e (diff) | |
Tweaks to test setup; don't always compute coverage.
Diffstat (limited to 'test')
| -rw-r--r-- | test/image_test.cc | 2 | ||||
| -rw-r--r-- | test/rgb_xyz_test.cc | 10 | ||||
| -rw-r--r-- | test/test.cc | 18 | ||||
| -rw-r--r-- | test/test.h | 4 |
4 files changed, 10 insertions, 24 deletions
diff --git a/test/image_test.cc b/test/image_test.cc index 6b024c1a..216c3c5c 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -44,7 +44,7 @@ public: } - uint16_t * const * data () const { + uint8_t * const * data () const { return 0; } diff --git a/test/rgb_xyz_test.cc b/test/rgb_xyz_test.cc index b33a0f4a..2927bd9a 100644 --- a/test/rgb_xyz_test.cc +++ b/test/rgb_xyz_test.cc @@ -34,7 +34,7 @@ public: { /* 48bpp */ _stride[0] = _size.width * 6; - _data[0] = new uint16_t[size.height * stride()[0] / 2]; + _data[0] = new uint8_t[size.height * stride()[0]]; } ~SimpleImage () @@ -42,7 +42,7 @@ public: delete[] _data[0]; } - uint16_t * const * data () const { + uint8_t * const * data () const { return _data; } @@ -51,7 +51,7 @@ public: } private: - uint16_t* _data[1]; + uint8_t* _data[1]; int _stride[1]; }; @@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE (rgb_xyz_test) shared_ptr<const dcp::Image> rgb (new SimpleImage (size)); for (int y = 0; y < size.height; ++y) { - uint16_t* p = rgb->data()[0] + y * rgb->stride()[0] / 2; + uint16_t* p = reinterpret_cast<uint16_t*> (rgb->data()[0] + y * rgb->stride()[0]); for (int x = 0; x < size.width; ++x) { /* Write a 12-bit random number for each component */ for (int c = 0; c < 3; ++c) { @@ -76,7 +76,7 @@ BOOST_AUTO_TEST_CASE (rgb_xyz_test) shared_ptr<dcp::XYZFrame> xyz = dcp::rgb_to_xyz (rgb, dcp::ColourConversion::srgb_to_xyz); for (int y = 0; y < size.height; ++y) { - uint16_t* p = rgb->data()[0] + y * rgb->stride()[0] / 2; + uint16_t* p = reinterpret_cast<uint16_t*> (rgb->data()[0] + y * rgb->stride()[0]); for (int x = 0; x < size.width; ++x) { double cr = *p++ / 65535.0; diff --git a/test/test.cc b/test/test.cc index 995a5b23..dee78bfd 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2015 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 @@ -25,7 +25,7 @@ using std::string; -string private_test; +boost::filesystem::path private_test; struct TestConfig { @@ -39,17 +39,3 @@ struct TestConfig }; BOOST_GLOBAL_FIXTURE (TestConfig); - -boost::filesystem::path -j2c (int) -{ - return "test/data/32x32_red_square.j2c"; -} - -boost::filesystem::path -wav (dcp::Channel) -{ - return "test/data/1s_24-bit_48k_silence.wav"; -} - - diff --git a/test/test.h b/test/test.h index f139fa28..c5ae5268 100644 --- a/test/test.h +++ b/test/test.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2015 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 @@ -17,4 +17,4 @@ */ -extern std::string private_test; +extern boost::filesystem::path private_test; |
