Try to fix crash on looking up endpoint of a disconnected socket.
[dcpomatic.git] / test / image_test.cc
index 8dc2896023c6215914bbe70f17d2ceeb08fc7c29..82ebe0b1ff5e6825c0db29bbd92f8fc2495092f8 100644 (file)
@@ -1,3 +1,27 @@
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    This program 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.
+
+    This program 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
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <boost/test/unit_test.hpp>
+#include "lib/image.h"
+#include "lib/scaler.h"
+
+using boost::shared_ptr;
 
 BOOST_AUTO_TEST_CASE (aligned_image_test)
 {
@@ -123,7 +147,7 @@ BOOST_AUTO_TEST_CASE (crop_image_test2)
        image = image->crop (crop, true);
 
        /* Convert it back to RGB to make comparison to black easier */
-       image = image->scale_and_convert_to_rgb (image->size(), Scaler::from_id ("bicubic"), true);
+       image = image->scale (image->size(), Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true);
 
        /* Check that its still black after the crop */
        uint8_t* p = image->data()[0];