Put Image in dcpomatic:: to avoid Fastvideo name clash.
[dcpomatic.git] / test / client_server_test.cc
index 29f901d34b96951bbe94441516909303b2662f43..6146bdeb07112980fd33d3c157ed336aacd4222d 100644 (file)
@@ -37,6 +37,7 @@
 #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>
 
@@ -46,6 +47,8 @@ using boost::thread;
 using boost::optional;
 using boost::weak_ptr;
 using dcp::Data;
+using namespace dcpomatic;
+
 
 void
 do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, Data locally_encoded)
@@ -85,7 +88,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
                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 (
@@ -99,7 +102,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
                        ColourConversion(),
                        VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -122,7 +126,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
        thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
 
        /* Let the server get itself ready */
-       dcpomatic_sleep (1);
+       dcpomatic_sleep_seconds (1);
 
        /* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
        EncodeServerDescription description ("127.0.0.1", 1, SERVER_LINK_VERSION);
@@ -170,7 +174,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
                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 (
@@ -184,7 +188,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
                        ColourConversion(),
                        VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -207,7 +212,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
        thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
 
        /* Let the server get itself ready */
-       dcpomatic_sleep (1);
+       dcpomatic_sleep_seconds (1);
 
        /* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
        EncodeServerDescription description ("127.0.0.1", 2, SERVER_LINK_VERSION);
@@ -242,7 +247,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 (
@@ -256,7 +261,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
                        ColourConversion(),
                        VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -284,7 +290,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
                        PresetColourConversion::all().front().conversion,
                        VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -305,7 +312,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
        thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
 
        /* Let the server get itself ready */
-       dcpomatic_sleep (1);
+       dcpomatic_sleep_seconds (1);
 
        /* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
        EncodeServerDescription description ("127.0.0.1", 2, SERVER_LINK_VERSION);