From e83a3bbfd18188996f4d18305cb5efd136ba5b1c Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 7 Jun 2015 16:24:52 +0100 Subject: [PATCH] add a test for byteswap() --- TODO | 2 -- test/test_conversion.py | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 7ff02dbd..0a4d59de 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ -- add tests for bandfold/unfold, byteswap - - how about something like vips_grid() which turns a tall thin one-band image into a much smaller many-band image? diff --git a/test/test_conversion.py b/test/test_conversion.py index 0d41c4fa..18fa9865 100755 --- a/test/test_conversion.py +++ b/test/test_conversion.py @@ -237,6 +237,14 @@ class TestConversion(unittest.TestCase): self.assertEqual(y.bands, 1) self.assertEqual(x.avg(), y.avg()) + def test_byteswap(self): + x = self.mono.cast("ushort") + y = x.byteswap().byteswap() + self.assertEqual(x.width, y.width) + self.assertEqual(x.height, y.height) + self.assertEqual(x.bands, y.bands) + self.assertEqual(x.avg(), y.avg()) + def test_embed(self): for fmt in all_formats: test = self.colour.cast(fmt)