projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing ConfigRestorer in test.
[dcpomatic.git]
/
test
/
client_server_test.cc
diff --git
a/test/client_server_test.cc
b/test/client_server_test.cc
index 3dceb31b0623a400c0cccde9b82c690d055e619c..7a99f72274758a1bace8f1e9f637fe7e1c61d502 100644
(file)
--- a/
test/client_server_test.cc
+++ b/
test/client_server_test.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2012-20
18
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-20
21
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,6
+18,7
@@
*/
*/
+
/** @file test/client_server_test.cc
* @brief Test the server class.
* @ingroup feature
/** @file test/client_server_test.cc
* @brief Test the server class.
* @ingroup feature
@@
-27,28
+28,31
@@
* encoded data to check that they are the same.
*/
* encoded data to check that they are the same.
*/
-#include "lib/encode_server.h"
-#include "lib/image.h"
+
#include "lib/cross.h"
#include "lib/dcp_video.h"
#include "lib/cross.h"
#include "lib/dcp_video.h"
-#include "lib/player_video.h"
-#include "lib/raw_image_proxy.h"
-#include "lib/j2k_image_proxy.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/encode_server.h"
#include "lib/encode_server_description.h"
#include "lib/file_log.h"
#include "lib/encode_server_description.h"
#include "lib/file_log.h"
-#include "lib/dcpomatic_log.h"
+#include "lib/image.h"
+#include "lib/j2k_image_proxy.h"
+#include "lib/player_video.h"
+#include "lib/raw_image_proxy.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
+
using std::list;
using std::list;
+using std::make_shared;
using std::shared_ptr;
using std::weak_ptr;
using std::shared_ptr;
using std::weak_ptr;
-using std::make_shared;
using boost::thread;
using boost::optional;
using dcp::ArrayData;
using boost::thread;
using boost::optional;
using dcp::ArrayData;
+
void
do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, ArrayData locally_encoded)
{
void
do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, ArrayData locally_encoded)
{
@@
-59,9
+63,10
@@
do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription descriptio
BOOST_CHECK_EQUAL (memcmp (locally_encoded.data(), remotely_encoded.data(), locally_encoded.size()), 0);
}
BOOST_CHECK_EQUAL (memcmp (locally_encoded.data(), remotely_encoded.data(), locally_encoded.size()), 0);
}
+
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
{
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
{
- auto image = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size (1998, 1080),
true
);
+ auto image = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size (1998, 1080),
Image::Alignment::PADDED
);
uint8_t* p = image->data()[0];
for (int y = 0; y < 1080; ++y) {
uint8_t* p = image->data()[0];
for (int y = 0; y < 1080; ++y) {
@@
-74,7
+79,7
@@
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
p += image->stride()[0];
}
p += image->stride()[0];
}
- auto sub_image = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size (100, 200),
true
);
+ auto sub_image = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size (100, 200),
Image::Alignment::PADDED
);
p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
@@
-145,9
+150,10
@@
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
delete server;
}
delete server;
}
+
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
{
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
{
- auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080),
true
);
+ auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080),
Image::Alignment::PADDED
);
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
@@
-156,7
+162,7
@@
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
}
}
}
}
- auto sub_image = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size (100, 200),
true
);
+ auto sub_image = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size (100, 200),
Image::Alignment::PADDED
);
uint8_t* p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
uint8_t* p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
@@
-227,9
+233,10
@@
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
delete server;
}
delete server;
}
+
BOOST_AUTO_TEST_CASE (client_server_test_j2k)
{
BOOST_AUTO_TEST_CASE (client_server_test_j2k)
{
- auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080),
true
);
+ auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080),
Image::Alignment::PADDED
);
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];