From 10f55bf3a2ac9340263a410fa2a69f1360f5c227 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 23 Nov 2013 12:37:15 +0000 Subject: [PATCH] Small FileGroup tidy-up; actually build FileGroup test; rearrange test wscript. --- src/lib/file_group.cc | 4 +--- test/file_group_test.cc | 3 +-- test/wscript | 37 +++++++++++++++++++------------------ 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/lib/file_group.cc b/src/lib/file_group.cc index d364a395d..cdd78c6a3 100644 --- a/src/lib/file_group.cc +++ b/src/lib/file_group.cc @@ -73,8 +73,6 @@ FileGroup::ensure_open_path (size_t p) const int64_t FileGroup::seek (int64_t pos, int whence) const { - int64_t const len = length (); - /* Convert pos to `full_pos', which is an offset from the start of all the files. */ @@ -91,7 +89,7 @@ FileGroup::seek (int64_t pos, int whence) const full_pos += pos; break; case SEEK_END: - full_pos = len - pos; + full_pos = length() - pos; break; } diff --git a/test/file_group_test.cc b/test/file_group_test.cc index 6f66d8804..14c01a976 100644 --- a/test/file_group_test.cc +++ b/test/file_group_test.cc @@ -62,8 +62,7 @@ BOOST_AUTO_TEST_CASE (file_group_test) base += length[i]; } - FileGroup fg; - fg.set_paths (name); + FileGroup fg (name); uint8_t test[65536]; int pos = 0; diff --git a/test/wscript b/test/wscript index b40b69475..5a1114904 100644 --- a/test/wscript +++ b/test/wscript @@ -15,31 +15,32 @@ def build(bld): obj.uselib = 'BOOST_TEST DCP OPENJPEG AVFORMAT AVFILTER AVCODEC AVUTIL SWSCALE POSTPROC CXML' obj.use = 'libdcpomatic' obj.source = """ - test.cc - scaling_test.cc - film_metadata_test.cc - frame_rate_test.cc - colour_conversion_test.cc + 4k_test.cc audio_delay_test.cc - silence_padding_test.cc audio_merger_test.cc - resampler_test.cc + black_fill_test.cc + client_server_test.cc + colour_conversion_test.cc ffmpeg_audio_test.cc - threed_test.cc - play_test.cc - ffmpeg_pts_offset.cc + ffmpeg_dcp_test.cc ffmpeg_examiner_test.cc - black_fill_test.cc - ratio_test.cc - pixel_formats_test.cc + ffmpeg_pts_offset.cc + file_group_test.cc + film_metadata_test.cc + frame_rate_test.cc + image_test.cc + job_test.cc make_black_test.cc + pixel_formats_test.cc + play_test.cc + ratio_test.cc + resampler_test.cc + scaling_test.cc + silence_padding_test.cc stream_test.cc + test.cc + threed_test.cc util_test.cc - ffmpeg_dcp_test.cc - job_test.cc - client_server_test.cc - image_test.cc - 4k_test.cc """ obj.target = 'unit-tests' -- 2.30.2