/*
- 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.
*/
+
+
/** @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"
#include <list>
#include <vector>
+
using std::abs;
using std::cerr;
using std::cout;
Config::instance()->set_decryption_chain (decryption);
}
+
class TestSignalManager : public SignalManager
{
public:
}
};
+
BOOST_GLOBAL_FIXTURE (TestConfig);
+
boost::filesystem::path
test_film_dir (string name)
{
return p;
}
+
shared_ptr<Film>
new_test_film (string name)
{
return film;
}
+
shared_ptr<Film>
new_test_film2 (string name, vector<shared_ptr<Content>> content, Cleanup* cleanup)
{
return film;
}
+
void
check_wav_file (boost::filesystem::path ref, boost::filesystem::path check)
{
}
}
+
void
check_mxf_audio_file (boost::filesystem::path ref, boost::filesystem::path check)
{
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;
fclose (check_file);
}
+
static void
note (dcp::NoteType t, string n)
{