diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-05-02 19:31:50 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-05-04 19:37:38 +0200 |
| commit | 9a947571edec16a85830837b7b149e1ea2776bac (patch) | |
| tree | 9c80f84227cfaec01315545ade0deed6ae87e16b | |
| parent | 784020963f518aaba48b18b3fcff55d5c28a1f28 (diff) | |
C++11 tidying.
| -rw-r--r-- | src/object.h | 12 | ||||
| -rw-r--r-- | test/recovery_test.cc | 9 | ||||
| -rw-r--r-- | test/test.cc | 13 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/object.h b/src/object.h index 89da0fd8..dcb6c69d 100644 --- a/src/object.h +++ b/src/object.h @@ -44,13 +44,13 @@ #include <string> -struct write_interop_subtitle_test; +struct sync_test2; struct write_interop_subtitle_test2; struct write_interop_subtitle_test3; -struct write_smpte_subtitle_test; +struct write_interop_subtitle_test; struct write_smpte_subtitle_test2; struct write_smpte_subtitle_test3; -struct sync_test2; +struct write_smpte_subtitle_test; namespace dcp { @@ -86,13 +86,13 @@ public: } protected: - friend struct ::write_interop_subtitle_test; + friend struct ::sync_test2; friend struct ::write_interop_subtitle_test2; friend struct ::write_interop_subtitle_test3; - friend struct ::write_smpte_subtitle_test; + friend struct ::write_interop_subtitle_test; friend struct ::write_smpte_subtitle_test2; friend struct ::write_smpte_subtitle_test3; - friend struct ::sync_test2; + friend struct ::write_smpte_subtitle_test; std::string _id; }; diff --git a/test/recovery_test.cc b/test/recovery_test.cc index 62cb961a..43e5b93d 100644 --- a/test/recovery_test.cc +++ b/test/recovery_test.cc @@ -31,16 +31,19 @@ files in the program, then also delete it here. */ + #include "mono_picture_asset_writer.h" #include "mono_picture_asset.h" #include "test.h" #include <asdcp/KM_util.h> -#include <boost/test/unit_test.hpp> #include <boost/filesystem.hpp> +#include <boost/test/unit_test.hpp> + -using std::string; -using std::shared_ptr; using std::make_shared; +using std::shared_ptr; +using std::string; + /** Check that recovery from a partially-written MXF works */ BOOST_AUTO_TEST_CASE (recovery) diff --git a/test/test.cc b/test/test.cc index e1a7e84e..b20678cd 100644 --- a/test/test.cc +++ b/test/test.cc @@ -217,19 +217,19 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) BOOST_REQUIRE (check_file); int const buffer_size = 65536; - auto ref_buffer = new uint8_t[buffer_size]; - auto check_buffer = new uint8_t[buffer_size]; + std::vector<uint8_t> ref_buffer(buffer_size); + std::vector<uint8_t> check_buffer(buffer_size); uintmax_t pos = 0; while (pos < size) { uintmax_t this_time = min (uintmax_t(buffer_size), size - pos); - size_t r = ref_file.read(ref_buffer, 1, this_time); + size_t r = ref_file.read(ref_buffer.data(), 1, this_time); BOOST_CHECK_EQUAL (r, this_time); - r = check_file.read(check_buffer, 1, this_time); + r = check_file.read(check_buffer.data(), 1, this_time); BOOST_CHECK_EQUAL (r, this_time); - if (memcmp(ref_buffer, check_buffer, this_time) != 0) { + if (memcmp(ref_buffer.data(), check_buffer.data(), this_time) != 0) { for (int i = 0; i < buffer_size; ++i) { if (ref_buffer[i] != check_buffer[i]) { BOOST_CHECK_MESSAGE ( @@ -244,9 +244,6 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) pos += this_time; } - - delete[] ref_buffer; - delete[] check_buffer; } |
