summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asset_test.cc2
-rw-r--r--test/rgb_xyz_test.cc8
-rw-r--r--test/wscript18
3 files changed, 17 insertions, 11 deletions
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']