Remove pointless subheading in Keys->Advanced dialogues and improve spacing in the...
[dcpomatic.git] / test / client_server_test.cc
index 10286c72a256b63c9a78829f0f8f3cab8c2d60b6..75cee85b325e5e4d2b452463af3ca21231edd67f 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>
 
@@ -85,7 +86,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 (
@@ -97,8 +98,10 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
                        EYES_BOTH,
                        PART_WHOLE,
                        ColourConversion(),
+                       VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -121,7 +124,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);
@@ -169,7 +172,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 (
@@ -181,8 +184,10 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
                        EYES_BOTH,
                        PART_WHOLE,
                        ColourConversion(),
+                       VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -205,7 +210,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);
@@ -240,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 (
@@ -252,8 +257,10 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
                        EYES_BOTH,
                        PART_WHOLE,
                        ColourConversion(),
+                       VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -279,8 +286,10 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
                        EYES_BOTH,
                        PART_WHOLE,
                        PresetColourConversion::all().front().conversion,
+                       VIDEO_RANGE_FULL,
                        weak_ptr<Content>(),
-                       optional<Frame>()
+                       optional<Frame>(),
+                       false
                        )
                );
 
@@ -301,7 +310,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);