X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ftest.h;h=8733c7c319d42d92c986e95ea933b4eae5dd9320;hb=498806d76160a6b1fa0af58e7734c0f553abf12b;hp=dc704004b80ade213cd0b17f4688707848eafaeb;hpb=41fc6e366ad3de85704c35961beaf539ab9ceb8b;p=libdcp.git diff --git a/test/test.h b/test/test.h index dc704004..8733c7c3 100644 --- a/test/test.h +++ b/test/test.h @@ -1,22 +1,67 @@ /* - Copyright (C) 2012-2013 Carl Hetherington + Copyright (C) 2012-2020 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of libdcp. + + libdcp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + libdcp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - + along with libdcp. If not, see . */ -extern boost::filesystem::path j2c (int); -extern boost::filesystem::path wav (dcp::Channel); -extern std::string test_corpus; + +#include "cpl.h" +#include "dcp.h" +#include "reel.h" +#include "reel_subtitle_asset.h" +#include "subtitle.h" +#include "reel_asset.h" +#include +#include + +namespace xmlpp { + class Element; +} + +namespace dcp { + class DCP; + class MonoPictureAsset; + class SoundAsset; +} + +extern boost::filesystem::path private_test; +extern boost::filesystem::path xsd_test; + +extern void check_xml (xmlpp::Element* ref, xmlpp::Element* test, std::vector ignore_tags, bool ignore_whitespace = false); +extern void check_xml (std::string ref, std::string test, std::vector ignore, bool ignore_whitespace = false); +extern void check_file (boost::filesystem::path ref, boost::filesystem::path check); +extern std::shared_ptr simple_picture (boost::filesystem::path path, std::string suffix, int frames = 24); +extern std::shared_ptr simple_sound (boost::filesystem::path path, std::string suffix, dcp::MXFMetadata mxf_meta, std::string language, int frames = 24, int sample_rate = 48000); +extern std::shared_ptr simple_subtitle (); +extern std::shared_ptr simple_markers (int frames = 24); +extern std::shared_ptr make_simple (boost::filesystem::path path, int reels = 1, int frames = 24, dcp::Standard = dcp::Standard::SMPTE); +extern std::shared_ptr make_simple_with_interop_subs (boost::filesystem::path path); +extern std::shared_ptr make_simple_with_smpte_subs (boost::filesystem::path path); +extern std::shared_ptr make_simple_with_interop_ccaps (boost::filesystem::path path); +extern std::shared_ptr make_simple_with_smpte_ccaps (boost::filesystem::path path); +extern std::shared_ptr black_image (dcp::Size size = dcp::Size(1998, 1080)); +extern std::shared_ptr black_picture_asset (boost::filesystem::path dir, int frames = 24); +extern boost::filesystem::path find_file (boost::filesystem::path dir, std::string filename_part); + +/** Creating an object of this class will make asdcplib's random number generation + * (more) predictable. + */ +class RNGFixer +{ +public: + RNGFixer (); + ~RNGFixer (); +};