summaryrefslogtreecommitdiff
path: root/test/gamma_transfer_function_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-05-05 15:35:03 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-05 21:09:40 +0200
commitc96b513ba50e992b237a26fa9fc7eeeaf369635b (patch)
tree86181f6fa38727c6d011b03a6a8bca3c825c8f69 /test/gamma_transfer_function_test.cc
parenta43d2a3283c5e5dcbdb40154b5701deec7966fd5 (diff)
Tidying.
Diffstat (limited to 'test/gamma_transfer_function_test.cc')
-rw-r--r--test/gamma_transfer_function_test.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/gamma_transfer_function_test.cc b/test/gamma_transfer_function_test.cc
index 993f4e9b..6e454b76 100644
--- a/test/gamma_transfer_function_test.cc
+++ b/test/gamma_transfer_function_test.cc
@@ -31,24 +31,27 @@
files in the program, then also delete it here.
*/
+
#include "gamma_transfer_function.h"
#include "modified_gamma_transfer_function.h"
#include <boost/test/unit_test.hpp>
+
+using std::make_shared;
using std::shared_ptr;
+
/** Check GammaTransferFunction::about_equal */
BOOST_AUTO_TEST_CASE (gamma_transfer_function_test)
{
- shared_ptr<dcp::GammaTransferFunction> a (new dcp::GammaTransferFunction (1.2));
- shared_ptr<dcp::GammaTransferFunction> b (new dcp::GammaTransferFunction (1.2));
+ auto a = make_shared<dcp::GammaTransferFunction>(1.2);
+ auto b = make_shared<dcp::GammaTransferFunction>(1.2);
BOOST_CHECK (a->about_equal (b, 1e-6));
- a.reset (new dcp::GammaTransferFunction (1.2));
- a.reset (new dcp::GammaTransferFunction (1.3));
+ a = make_shared<dcp::GammaTransferFunction>(1.3);
BOOST_CHECK (a->about_equal (b, 0.2));
BOOST_CHECK (!a->about_equal (b, 0.05));
- shared_ptr<dcp::ModifiedGammaTransferFunction> c (new dcp::ModifiedGammaTransferFunction (2.4, 0.05, 1, 2));
+ auto c = make_shared<dcp::ModifiedGammaTransferFunction>(2.4, 0.05, 1, 2);
BOOST_CHECK (!a->about_equal (c, 1));
}