diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-02-27 21:16:59 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-02-27 21:17:39 +0100 |
| commit | 08cf432a8cc9bd0289e76bf684fb5264a7cfc7a7 (patch) | |
| tree | cad597ac6e13c5f37807713d7d95daacfc668746 /test/test.cc | |
| parent | ed696661eff88297b4ad51625d596248697b1891 (diff) | |
Try to fix text-file-checking test on Windows.
Diffstat (limited to 'test/test.cc')
| -rw-r--r-- | test/test.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/test.cc b/test/test.cc index 1e84d5162..27393386b 100644 --- a/test/test.cc +++ b/test/test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,10 +18,13 @@ */ + + /** @file test/test.cc * @brief Overall test stuff and useful methods for tests. */ + #include "lib/compose.hpp" #include "lib/config.h" #include "lib/cross.h" @@ -61,6 +64,7 @@ extern "C" { #include <list> #include <vector> + using std::abs; using std::cerr; using std::cout; @@ -123,6 +127,7 @@ setup_test_config () Config::instance()->set_decryption_chain (decryption); } + class TestSignalManager : public SignalManager { public: @@ -156,8 +161,10 @@ struct TestConfig } }; + BOOST_GLOBAL_FIXTURE (TestConfig); + boost::filesystem::path test_film_dir (string name) { @@ -168,6 +175,7 @@ test_film_dir (string name) return p; } + shared_ptr<Film> new_test_film (string name) { @@ -181,6 +189,7 @@ new_test_film (string name) return film; } + shared_ptr<Film> new_test_film2 (string name, vector<shared_ptr<Content>> content, Cleanup* cleanup) { @@ -205,6 +214,7 @@ new_test_film2 (string name, vector<shared_ptr<Content>> content, Cleanup* clean return film; } + void check_wav_file (boost::filesystem::path ref, boost::filesystem::path check) { @@ -248,6 +258,7 @@ check_wav_file (boost::filesystem::path ref, boost::filesystem::path check) } } + void check_mxf_audio_file (boost::filesystem::path ref, boost::filesystem::path check) { @@ -434,13 +445,13 @@ check_image (boost::filesystem::path ref, boost::filesystem::path check, double void -check_file (boost::filesystem::path ref, boost::filesystem::path check) +check_file (boost::filesystem::path ref, boost::filesystem::path check, bool binary_mode) { auto N = boost::filesystem::file_size (ref); BOOST_CHECK_EQUAL (N, boost::filesystem::file_size (check)); - auto ref_file = fopen_boost (ref, "rb"); + auto ref_file = fopen_boost (ref, binary_mode ? "rb" : "r"); BOOST_CHECK (ref_file); - auto check_file = fopen_boost (check, "rb"); + auto check_file = fopen_boost (check, binary_mode ? "rb" : "r"); BOOST_CHECK (check_file); int const buffer_size = 65536; @@ -471,6 +482,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) fclose (check_file); } + static void note (dcp::NoteType t, string n) { |
