projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use make_shared<>.
[dcpomatic.git]
/
test
/
audio_processor_delay_test.cc
diff --git
a/test/audio_processor_delay_test.cc
b/test/audio_processor_delay_test.cc
index 498b712da0285503cdc99f9ee5322f4ba5b5a6b9..9fc2d7242cb359d6b23b32a4de9c56cc54483291 100644
(file)
--- a/
test/audio_processor_delay_test.cc
+++ b/
test/audio_processor_delay_test.cc
@@
-1,31
+1,34
@@
/*
Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
/*
Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
- This program is free software; you can redistribute it and/or modify
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
This program
is distributed in the hope that it will be useful,
+
DCP-o-matic
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
*/
#include "lib/audio_delay.h"
#include "lib/audio_buffers.h"
#include <boost/test/unit_test.hpp>
*/
#include "lib/audio_delay.h"
#include "lib/audio_buffers.h"
#include <boost/test/unit_test.hpp>
+#include <boost/make_shared.hpp>
#include <cmath>
#include <iostream>
using std::cerr;
using std::cout;
using boost::shared_ptr;
#include <cmath>
#include <iostream>
using std::cerr;
using std::cout;
using boost::shared_ptr;
+using boost::make_shared;
#define CHECK_SAMPLE(c,f,r) \
if (fabs(out->data(c)[f] - (r)) > 0.1) { \
#define CHECK_SAMPLE(c,f,r) \
if (fabs(out->data(c)[f] - (r)) > 0.1) { \
@@
-40,7
+43,7
@@
BOOST_AUTO_TEST_CASE (audio_processor_delay_test1)
int const C = 2;
int const C = 2;
- shared_ptr<AudioBuffers> in
(new AudioBuffers (C, 256)
);
+ shared_ptr<AudioBuffers> in
= make_shared<AudioBuffers> (C, 256
);
for (int i = 0; i < C; ++i) {
for (int j = 0; j < 256; ++j) {
in->data(i)[j] = j;
for (int i = 0; i < C; ++i) {
for (int j = 0; j < 256; ++j) {
in->data(i)[j] = j;
@@
-90,7
+93,7
@@
BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
/* Feeding 4 blocks of 64 should give silence each time */
for (int i = 0; i < 4; ++i) {
/* Feeding 4 blocks of 64 should give silence each time */
for (int i = 0; i < 4; ++i) {
- shared_ptr<AudioBuffers> in
(new AudioBuffers (C, 64)
);
+ shared_ptr<AudioBuffers> in
= make_shared<AudioBuffers> (C, 64
);
for (int j = 0; j < C; ++j) {
for (int k = 0; k < 64; ++k) {
in->data(j)[k] = k + i * 64;
for (int j = 0; j < C; ++j) {
for (int k = 0; k < 64; ++k) {
in->data(j)[k] = k + i * 64;
@@
-111,7
+114,7
@@
BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
/* Now feed 4 blocks of silence and we should see the data */
for (int i = 0; i < 4; ++i) {
/* Feed some silence */
/* Now feed 4 blocks of silence and we should see the data */
for (int i = 0; i < 4; ++i) {
/* Feed some silence */
- shared_ptr<AudioBuffers> in
(new AudioBuffers (C, 64)
);
+ shared_ptr<AudioBuffers> in
= make_shared<AudioBuffers> (C, 64
);
in->make_silent ();
shared_ptr<AudioBuffers> out = delay.run (in);
in->make_silent ();
shared_ptr<AudioBuffers> out = delay.run (in);