summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-23 16:41:21 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-23 16:41:21 +0000
commitbc2b4bb709683de594f08c4db0228c11f14bbf66 (patch)
tree140baa3254579b3960b54a77dc03dc7876ca1b67
parenta869c520e4c75ee16cc9c07b96bd4886aae39f8a (diff)
parent960fa45a5852452418188d55adfd6172a8a77a4a (diff)
Merge branch '1.0' of git.carlh.net:git/libdcp into 1.0
-rw-r--r--asdcplib/src/KM_tai.cpp1
-rw-r--r--cscript2
-rw-r--r--src/rgb_xyz.cc6
-rw-r--r--test/asset_test.cc2
-rw-r--r--test/rgb_xyz_test.cc8
-rw-r--r--test/wscript18
-rw-r--r--wscript4
7 files changed, 25 insertions, 16 deletions
diff --git a/asdcplib/src/KM_tai.cpp b/asdcplib/src/KM_tai.cpp
index 2cbd1253..509e8632 100644
--- a/asdcplib/src/KM_tai.cpp
+++ b/asdcplib/src/KM_tai.cpp
@@ -190,6 +190,7 @@ Kumu::TAI::tai::now()
ct.hour = st.wHour;
ct.minute = st.wMinute;
ct.second = st.wSecond;
+ ct.offset = 0;
caltime_tai(&ct, this);
#else
struct timeval now;
diff --git a/cscript b/cscript
index 6a59c576..1e0e2344 100644
--- a/cscript
+++ b/cscript
@@ -12,7 +12,7 @@ def build(target, options):
if (target.distro == 'debian' and target.version == 'unstable' or target.distro == 'fedora' and target.version == '23'):
target.append_with_space('CXXFLAGS', '-std=c++11')
elif target.platform == 'windows':
- cmd += ' --target-windows --disable-tests'
+ cmd += ' --target-windows --disable-gcov'
elif target.platform == 'osx':
cmd += ' --disable-tests'
diff --git a/src/rgb_xyz.cc b/src/rgb_xyz.cc
index 23c99897..78083a7d 100644
--- a/src/rgb_xyz.cc
+++ b/src/rgb_xyz.cc
@@ -305,9 +305,9 @@ dcp::rgb_to_xyz (
d.z = min (65535.0, d.z);
/* Out gamma LUT */
- *xyz_x++ = lut_out[lrint(d.x)] * 4095;
- *xyz_y++ = lut_out[lrint(d.y)] * 4095;
- *xyz_z++ = lut_out[lrint(d.z)] * 4095;
+ *xyz_x++ = lrint (lut_out[lrint(d.x)] * 4095);
+ *xyz_y++ = lrint (lut_out[lrint(d.y)] * 4095);
+ *xyz_z++ = lrint (lut_out[lrint(d.z)] * 4095);
}
}
diff --git a/test/asset_test.cc b/test/asset_test.cc
index adaeb4a1..c53aca68 100644
--- a/test/asset_test.cc
+++ b/test/asset_test.cc
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-y Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
diff --git a/test/rgb_xyz_test.cc b/test/rgb_xyz_test.cc
index c08d4979..8f5698fe 100644
--- a/test/rgb_xyz_test.cc
+++ b/test/rgb_xyz_test.cc
@@ -35,7 +35,7 @@ using boost::scoped_array;
/** Convert a test image from sRGB to XYZ and check that the transforms are right */
BOOST_AUTO_TEST_CASE (rgb_xyz_test)
{
- unsigned int seed = 0;
+ srand (0);
dcp::Size const size (640, 480);
scoped_array<uint8_t> rgb (new uint8_t[size.width * size.height * 6]);
@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE (rgb_xyz_test)
for (int x = 0; x < size.width; ++x) {
/* Write a 12-bit random number for each component */
for (int c = 0; c < 3; ++c) {
- *p = (rand_r (&seed) & 0xfff) << 4;
+ *p = (rand () & 0xfff) << 4;
++p;
}
}
@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE (xyz_rgb_range_test)
/** Convert an image from RGB to XYZ and back again */
BOOST_AUTO_TEST_CASE (rgb_xyz_round_trip_test)
{
- unsigned int seed = 0;
+ srand (0);
dcp::Size const size (640, 480);
scoped_array<uint8_t> rgb (new uint8_t[size.width * size.height * 6]);
@@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE (rgb_xyz_round_trip_test)
for (int x = 0; x < size.width; ++x) {
/* Write a 12-bit random number for each component */
for (int c = 0; c < 3; ++c) {
- *p = (rand_r (&seed) & 0xfff) << 4;
+ *p = (rand () & 0xfff) << 4;
++p;
}
}
diff --git a/test/wscript b/test/wscript
index 89bf2fb2..707b776f 100644
--- a/test/wscript
+++ b/test/wscript
@@ -9,9 +9,9 @@ def configure(conf):
#include <boost/test/unit_test.hpp>\n
int main() {}
""",
- msg='Checking for boost unit testing library',
- lib='boost_unit_test_framework%s' % boost_lib_suffix,
- uselib_store='BOOST_TEST')
+ msg='Checking for boost unit testing library',
+ lib='boost_unit_test_framework%s' % boost_lib_suffix,
+ uselib_store='BOOST_TEST')
conf.env.prepend_value('LINKFLAGS', '-Lsrc')
@@ -19,9 +19,12 @@ def build(bld):
obj = bld(features='cxx cxxprogram')
obj.name = 'tests'
obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML XMLSEC1 SNDFILE'
+ obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
if bld.is_defined('HAVE_GCOV'):
obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
obj.lib = ['gcov']
+ obj.cppflags.append('-ftest-coverage')
+ obj.cppflags.append('-fprofile-arcs')
else:
obj.use = 'libdcp%s' % bld.env.API_VERSION
obj.source = """
@@ -57,30 +60,33 @@ def build(bld):
"""
obj.target = 'tests'
obj.install_path = ''
- obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
obj = bld(features='cxx cxxprogram')
obj.name = 'subs_in_out'
obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML'
+ obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
if bld.is_defined('HAVE_GCOV'):
obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
obj.lib = ['gcov']
+ obj.cppflags.append('-ftest-coverage')
+ obj.cppflags.append('-fprofile-arcs')
else:
obj.use = 'libdcp%s' % bld.env.API_VERSION
obj.source = 'subs_in_out.cc'
obj.target = 'subs_in_out'
obj.install_path = ''
- obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
obj = bld(features='cxx cxxprogram')
obj.name = 'rewrite_subs'
obj.uselib = 'BOOST_TEST BOOST_FILESYSTEM OPENJPEG CXML'
+ obj.cppflags = ['-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
if bld.is_defined('HAVE_GCOV'):
obj.use = 'libdcp%s_gcov' % bld.env.API_VERSION
obj.lib = ['gcov']
+ obj.cppflags.append('-ftest-coverage')
+ obj.cppflags.append('-fprofile-arcs')
else:
obj.use = 'libdcp%s' % bld.env.API_VERSION
obj.source = 'rewrite_subs.cc'
obj.target = 'rewrite_subs'
obj.install_path = ''
- obj.cppflags = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline', '-fno-default-inline', '-fno-elide-constructors', '-g', '-O0']
diff --git a/wscript b/wscript
index b87022f6..3c475848 100644
--- a/wscript
+++ b/wscript
@@ -14,6 +14,7 @@ def options(opt):
opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
opt.add_option('--static', action='store_true', default=False, help='build libdcp and in-tree dependencies statically, and link statically to openjpeg and cxml')
opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
+ opt.add_option('--disable-gcov', action='store_true', default=False, help='don''t use gcov in tests')
opt.add_option('--disable-examples', action='store_true', default=False, help='disable building of examples')
def configure(conf):
@@ -122,7 +123,8 @@ def configure(conf):
if not conf.env.DISABLE_TESTS:
conf.recurse('test')
- conf.check(lib='gcov', define_name='HAVE_GCOV', mandatory=False)
+ if not conf.options.disable_gcov:
+ conf.check(lib='gcov', define_name='HAVE_GCOV', mandatory=False)
conf.recurse('asdcplib')
def build(bld):