X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Ffilm_metadata_test.cc;h=90f81deb6497ad168450ff24665ef4677eceeb3a;hb=2588c8f63f9ad3023fd5a5829d571b68af85b4d0;hp=1f06aa538568b6a83f57f75d36410eea47a69c3e;hpb=f75cc4ebbffea7a7953af20e8a2ea124767bf949;p=dcpomatic.git diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc index 1f06aa538..90f81deb6 100644 --- a/test/film_metadata_test.cc +++ b/test/film_metadata_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,10 @@ */ -#include +/** @file test/film_metadata_test.cc + * @brief Test some basic reading/writing of film metadata. + */ + #include #include #include @@ -27,21 +30,16 @@ #include "test.h" using std::string; -using std::stringstream; using std::list; using boost::shared_ptr; BOOST_AUTO_TEST_CASE (film_metadata_test) { - string const test_film = "build/test/film_metadata_test"; - - if (boost::filesystem::exists (test_film)) { - boost::filesystem::remove_all (test_film); - } + shared_ptr f = new_test_film ("film_metadata_test"); + boost::filesystem::path dir = test_film_dir ("film_metadata_test"); - shared_ptr f (new Film (test_film)); - f->_dci_date = boost::gregorian::from_undelimited_string ("20130211"); - BOOST_CHECK (f->container() == 0); + f->_isdcf_date = boost::gregorian::from_undelimited_string ("20130211"); + BOOST_CHECK (f->container() == Ratio::from_id ("185")); BOOST_CHECK (f->dcp_content_type() == 0); f->set_name ("fred"); @@ -52,9 +50,9 @@ BOOST_AUTO_TEST_CASE (film_metadata_test) list ignore; ignore.push_back ("Key"); - check_xml ("test/data/metadata.xml.ref", test_film + "/metadata.xml", ignore); + check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore); - shared_ptr g (new Film (test_film)); + shared_ptr g (new Film (dir)); g->read_metadata (); BOOST_CHECK_EQUAL (g->name(), "fred"); @@ -62,5 +60,5 @@ BOOST_AUTO_TEST_CASE (film_metadata_test) BOOST_CHECK_EQUAL (g->container(), Ratio::from_id ("185")); g->write_metadata (); - check_xml ("test/data/metadata.xml.ref", test_film + "/metadata.xml", ignore); + check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore); }