Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
[dcpomatic.git] / test / client_server_test.cc
index 5e4c2540e7b2fa3b5382cfa8571756d484c2b1c8..074ca0c9e8274f888d47159490b7a1d70b10523e 100644 (file)
@@ -49,9 +49,9 @@ void
 do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, Data locally_encoded)
 {
        Data remotely_encoded;
-       BOOST_CHECK_NO_THROW (remotely_encoded = frame->encode_remotely (description, 60));
+       BOOST_REQUIRE_NO_THROW (remotely_encoded = frame->encode_remotely (description, 60));
 
-       BOOST_CHECK_EQUAL (locally_encoded.size(), remotely_encoded.size());
+       BOOST_REQUIRE_EQUAL (locally_encoded.size(), remotely_encoded.size());
        BOOST_CHECK_EQUAL (memcmp (locally_encoded.data().get(), remotely_encoded.data().get(), locally_encoded.size()), 0);
 }
 
@@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
                p += image->stride()[0];
        }
 
-       shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true));
+       shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_BGRA, dcp::Size (100, 200), true));
        p = sub_image->data()[0];
        for (int y = 0; y < 200; ++y) {
                uint8_t* q = p;
@@ -120,7 +120,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
        /* Let the server get itself ready */
        dcpomatic_sleep (1);
 
-       EncodeServerDescription description ("localhost", 2);
+       /* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
+       EncodeServerDescription description ("127.0.0.1", 1);
 
        list<thread*> threads;
        for (int i = 0; i < 8; ++i) {
@@ -152,7 +153,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
                }
        }
 
-       shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true));
+       shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_BGRA, dcp::Size (100, 200), true));
        uint8_t* p = sub_image->data()[0];
        for (int y = 0; y < 200; ++y) {
                uint8_t* q = p;
@@ -202,7 +203,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
        /* Let the server get itself ready */
        dcpomatic_sleep (1);
 
-       EncodeServerDescription description ("localhost", 2);
+       /* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
+       EncodeServerDescription description ("127.0.0.1", 2);
 
        list<thread*> threads;
        for (int i = 0; i < 8; ++i) {
@@ -217,9 +219,9 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
                delete *i;
        }
 
+       server->stop ();
        server_thread->join ();
        delete server_thread;
-
        delete server;
 }
 
@@ -295,7 +297,8 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
        /* Let the server get itself ready */
        dcpomatic_sleep (1);
 
-       EncodeServerDescription description ("localhost", 2);
+       /* "localhost" rather than "127.0.0.1" here fails on docker; go figure */
+       EncodeServerDescription description ("127.0.0.1", 2);
 
        list<thread*> threads;
        for (int i = 0; i < 8; ++i) {