projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c3983e1
)
More logging and make it go to the right place.
author
Carl Hetherington
<cth@carlh.net>
Mon, 18 May 2020 23:39:47 +0000
(
01:39
+0200)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 20 May 2020 19:56:28 +0000
(21:56 +0200)
test/4k_test.cc
patch
|
blob
|
history
test/client_server_test.cc
patch
|
blob
|
history
test/optimise_stills_test.cc
patch
|
blob
|
history
test/test.cc
patch
|
blob
|
history
test/test.h
patch
|
blob
|
history
diff --git
a/test/4k_test.cc
b/test/4k_test.cc
index d8d3d66ec0e763c4a391564e9dbf0b88506895ad..0fe492133f5dc0e4a3bc546fa30667620375b79b 100644
(file)
--- a/
test/4k_test.cc
+++ b/
test/4k_test.cc
@@
-41,7
+41,7
@@
using boost::shared_ptr;
BOOST_AUTO_TEST_CASE (fourk_test)
{
shared_ptr<Film> film = new_test_film ("4k_test");
BOOST_AUTO_TEST_CASE (fourk_test)
{
shared_ptr<Film> film = new_test_film ("4k_test");
-
dcpomatic_log = film->log (
);
+
LogSwitcher ls (film->log()
);
film->set_name ("4k_test");
shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
film->set_resolution (RESOLUTION_4K);
film->set_name ("4k_test");
shared_ptr<FFmpegContent> c (new FFmpegContent("test/data/test.mp4"));
film->set_resolution (RESOLUTION_4K);
diff --git
a/test/client_server_test.cc
b/test/client_server_test.cc
index a64f4d295e6686d4da7f7b40c28b09db2905cb06..75cee85b325e5e4d2b452463af3ca21231edd67f 100644
(file)
--- a/
test/client_server_test.cc
+++ b/
test/client_server_test.cc
@@
-37,6
+37,7
@@
#include "lib/encode_server_description.h"
#include "lib/file_log.h"
#include "lib/dcpomatic_log.h"
#include "lib/encode_server_description.h"
#include "lib/file_log.h"
#include "lib/dcpomatic_log.h"
+#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
@@
-85,7
+86,7
@@
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
p += sub_image->stride()[0];
}
p += sub_image->stride()[0];
}
-
dcpomatic_log.reset (new FileLog("build/test/client_server_test_rgb.log"
));
+
LogSwitcher ls (shared_ptr<Log>(new FileLog("build/test/client_server_test_rgb.log")
));
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
@@
-171,7
+172,7
@@
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
p += sub_image->stride()[0];
}
p += sub_image->stride()[0];
}
-
dcpomatic_log.reset (new FileLog("build/test/client_server_test_yuv.log"
));
+
LogSwitcher ls (shared_ptr<Log>(new FileLog("build/test/client_server_test_yuv.log")
));
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
@@
-244,7
+245,7
@@
BOOST_AUTO_TEST_CASE (client_server_test_j2k)
}
}
}
}
-
dcpomatic_log.reset (new FileLog("build/test/client_server_test_j2k.log"
));
+
LogSwitcher ls (shared_ptr<Log>(new FileLog("build/test/client_server_test_j2k.log")
));
shared_ptr<PlayerVideo> raw_pvf (
new PlayerVideo (
shared_ptr<PlayerVideo> raw_pvf (
new PlayerVideo (
diff --git
a/test/optimise_stills_test.cc
b/test/optimise_stills_test.cc
index d9f8d262a1c17ad0353d018a56aefc3beaca2261..a57518b2d8aca5aa1c2f07800f960e85ba87ce8f 100644
(file)
--- a/
test/optimise_stills_test.cc
+++ b/
test/optimise_stills_test.cc
@@
-73,7
+73,7
@@
check (string name, int check_full, int check_repeat)
BOOST_AUTO_TEST_CASE (optimise_stills_test1)
{
shared_ptr<Film> film = new_test_film ("optimise_stills_test1");
BOOST_AUTO_TEST_CASE (optimise_stills_test1)
{
shared_ptr<Film> film = new_test_film ("optimise_stills_test1");
-
dcpomatic_log = film->log (
);
+
LogSwitcher ls (film->log()
);
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
@@
-90,7
+90,7
@@
BOOST_AUTO_TEST_CASE (optimise_stills_test1)
BOOST_AUTO_TEST_CASE (optimise_stills_test2)
{
shared_ptr<Film> film = new_test_film ("optimise_stills_test2");
BOOST_AUTO_TEST_CASE (optimise_stills_test2)
{
shared_ptr<Film> film = new_test_film ("optimise_stills_test2");
-
dcpomatic_log = film->log (
);
+
LogSwitcher ls (film->log()
);
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
diff --git
a/test/test.cc
b/test/test.cc
index b6e017acdb3a4a4a5fefbb16db61500f2a945393..3ec78e68b3c16377bcb821a90399473909c7671f 100644
(file)
--- a/
test/test.cc
+++ b/
test/test.cc
@@
-87,7
+87,7
@@
setup_test_config ()
Config::instance()->set_default_j2k_bandwidth (100000000);
Config::instance()->set_default_interop (false);
Config::instance()->set_default_still_length (10);
Config::instance()->set_default_j2k_bandwidth (100000000);
Config::instance()->set_default_interop (false);
Config::instance()->set_default_still_length (10);
- Config::instance()->set_log_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
+ Config::instance()->set_log_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR
| LogEntry::TYPE_DEBUG_THREED | LogEntry::TYPE_DEBUG_ENCODE
);
Config::instance()->set_automatic_audio_analysis (false);
}
Config::instance()->set_automatic_audio_analysis (false);
}
@@
-531,3
+531,17
@@
make_random_file (boost::filesystem::path path, size_t size)
fclose (r);
free (buffer);
}
fclose (r);
free (buffer);
}
+
+
+LogSwitcher::LogSwitcher (shared_ptr<Log> log)
+ : _old (dcpomatic_log)
+{
+ dcpomatic_log = log;
+}
+
+
+LogSwitcher::~LogSwitcher ()
+{
+ dcpomatic_log = _old;
+}
+
diff --git
a/test/test.h
b/test/test.h
index d793363d5cbfb998ce53eddf5220fdc96e8b9431..dd919b4087da3bcdaa6a42c9cf05493d11b19c04 100644
(file)
--- a/
test/test.h
+++ b/
test/test.h
@@
-20,9
+20,11
@@
#include <Magick++.h>
#include <boost/filesystem.hpp>
#include <Magick++.h>
#include <boost/filesystem.hpp>
+#include <boost/shared_ptr.hpp>
class Film;
class Image;
class Film;
class Image;
+class Log;
class TestPaths
class TestPaths
@@
-51,3
+53,14
@@
boost::filesystem::path dcp_file (boost::shared_ptr<const Film> film, std::strin
void check_one_frame (boost::filesystem::path dcp, int64_t index, boost::filesystem::path ref);
extern boost::filesystem::path subtitle_file (boost::shared_ptr<Film> film);
extern void make_random_file (boost::filesystem::path path, size_t size);
void check_one_frame (boost::filesystem::path dcp, int64_t index, boost::filesystem::path ref);
extern boost::filesystem::path subtitle_file (boost::shared_ptr<Film> film);
extern void make_random_file (boost::filesystem::path path, size_t size);
+
+class LogSwitcher
+{
+public:
+ LogSwitcher (boost::shared_ptr<Log> log);
+ ~LogSwitcher ();
+
+private:
+ boost::shared_ptr<Log> _old;
+};
+