From 02c186107dea1fa6f2e5b7accb3e7c127fb31bc7 Mon Sep 17 00:00:00 2001 From: jevans Date: Thu, 5 Sep 2013 21:39:05 -0400 Subject: [PATCH] Removing duplicated tests. #110 --- glymur/test/test_opj_suite.py | 639 +--------------------------------- 1 file changed, 9 insertions(+), 630 deletions(-) diff --git a/glymur/test/test_opj_suite.py b/glymur/test/test_opj_suite.py index 93e9745..c6dfbda 100644 --- a/glymur/test/test_opj_suite.py +++ b/glymur/test/test_opj_suite.py @@ -49,8 +49,9 @@ from .fixtures import OPENJPEG_VERSION, OPENJP2_IS_V2_OFFICIAL, OPJ_DATA_ROOT from .fixtures import mse, peak_tolerance, read_pgx, opj_data_file -@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None, - "Missing openjp2 library.") +@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None and + glymur.lib.openjpeg.OPENJPEG is None, + "Missing openjpeg libraries.") @unittest.skipIf(OPJ_DATA_ROOT is None, "OPJ_DATA_ROOT environment variable not set") class TestSuite(unittest.TestCase): @@ -725,6 +726,8 @@ class TestSuite(unittest.TestCase): jpdata = jp2k.read() self.assertEqual(jpdata.shape, (640, 480, 3)) + @unittest.skipIf(re.match(r"""1\.[0125]\.\d""", OPENJPEG_VERSION), + "Functionality not implemented for 1.x") def test_ETS_JP2_file3(self): jfile = opj_data_file('input/conformance/file3.jp2') jp2k = Jp2k(jfile) @@ -1034,6 +1037,8 @@ class TestSuite(unittest.TestCase): @unittest.skipIf(OPENJP2_IS_V2_OFFICIAL, "Test not in done in v2.0.0 official") + @unittest.skipIf(re.match(r"""1\.[0125]\.\d""", OPENJPEG_VERSION), + "Segfaults 1.5") def test_NR_DEC_gdal_fuzzer_check_comp_dx_dy_jp2_39_decode(self): relpath = 'input/nonregression/gdal_fuzzer_check_comp_dx_dy.jp2' jfile = opj_data_file(relpath) @@ -1050,6 +1055,8 @@ class TestSuite(unittest.TestCase): @unittest.skipIf(OPENJP2_IS_V2_OFFICIAL, "Test not in done in v2.0.0 official") + @unittest.skipIf(re.match(r"""1\.[0125]\.\d""", OPENJPEG_VERSION), + "Segfaults 1.5") @unittest.skipIf(sys.hexversion < 0x03020000, "Uses features introduced in 3.2.") def test_NR_DEC_issue188_beach_64bitsbox_jp2_41_decode(self): @@ -7310,633 +7317,5 @@ class TestSuiteDump(unittest.TestCase): [8, 9, 9, 10, 9, 9, 10, 9, 9, 10, 9, 9, 10, 9, 9, 10]) -@unittest.skipIf(glymur.lib.openjpeg.OPENJPEG is None, - "Missing openjpeg library.") -@unittest.skipIf(OPJ_DATA_ROOT is None, - "OPJ_DATA_ROOT environment variable not set") -class TestSuite15(unittest.TestCase): - """Suite of tests for libopenjpeg 1.5.1""" - - @classmethod - def setUpClass(cls): - # Monkey patch the package so as to use OPENJPEG instead of OPENJP2 - cls.openjp2 = glymur.lib.openjp2.OPENJP2 - glymur.lib.openjp2.OPENJP2 = None - - @classmethod - def tearDownClass(cls): - # Restore OPENJP2 - glymur.lib.openjp2.OPENJP2 = cls.openjp2 - - def setUp(self): - pass - - def tearDown(self): - pass - - def test_ETS_C0P0_p0_01_j2k(self): - jfile = opj_data_file('input/conformance/p0_01.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c0p0_01.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C0P0_p0_02_j2k(self): - jfile = opj_data_file('input/conformance/p0_02.j2k') - with warnings.catch_warnings(): - # There's a 0xff30 marker segment. Not illegal, but we don't - # really know what to do with it. Just ignore. - warnings.simplefilter("ignore") - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c0p0_02.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C0P0_p0_09_j2k(self): - jfile = opj_data_file('input/conformance/p0_09.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=2) - - pgxfile = opj_data_file('baseline/conformance/c0p0_09.pgx') - pgxdata = read_pgx(pgxfile) - - self.assertTrue(peak_tolerance(jpdata, pgxdata) < 4) - self.assertTrue(mse(jpdata, pgxdata) < 1.47) - - def test_ETS_C0P0_p0_11_j2k(self): - jfile = opj_data_file('input/conformance/p0_11.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c0p0_11.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - @unittest.skip("fprintf stderr output in r2343.") - def test_ETS_C0P0_p0_12_j2k(self): - jfile = opj_data_file('input/conformance/p0_12.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c0p0_12.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C0P0_p0_16_j2k(self): - jfile = opj_data_file('input/conformance/p0_16.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c0p0_16.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C0P1_p1_01_j2k(self): - jfile = opj_data_file('input/conformance/p1_01.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c0p1_01.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P0_p0_01_j2k(self): - jfile = opj_data_file('input/conformance/p0_01.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_01_0.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P0_p0_02_j2k(self): - jfile = opj_data_file('input/conformance/p0_02.j2k') - with warnings.catch_warnings(): - # There's a 0xff30 marker segment. Not illegal, but we don't - # really know what to do with it. Just ignore. - warnings.simplefilter("ignore") - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_02_0.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P0_p0_03_j2k(self): - jfile = opj_data_file('input/conformance/p0_03.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_03_0.pgx') - pgxdata = read_pgx(pgxfile) - - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P0_p0_04_j2k(self): - jfile = opj_data_file('input/conformance/p0_04.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_04_0.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 5) - self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 0.776) - - pgxfile = opj_data_file('baseline/conformance/c1p0_04_1.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 1], pgxdata) < 4) - self.assertTrue(mse(jpdata[:, :, 1], pgxdata) < 0.626) - - pgxfile = opj_data_file('baseline/conformance/c1p0_04_2.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 2], pgxdata) < 6) - self.assertTrue(mse(jpdata[:, :, 2], pgxdata) < 1.07) - - def test_ETS_C1P0_p0_08_j2k(self): - jfile = opj_data_file('input/conformance/p0_08.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=1) - - pgxfile = opj_data_file('baseline/conformance/c1p0_08_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 0], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_08_1.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 1], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_08_2.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 2], pgxdata) - - def test_ETS_C1P0_p0_09_j2k(self): - jfile = opj_data_file('input/conformance/p0_09.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_09_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P0_p0_10_j2k(self): - jfile = opj_data_file('input/conformance/p0_10.j2k') - jp2k = Jp2k(jfile) - with warnings.catch_warnings(): - # This file has an invalid ICC profile - warnings.simplefilter("ignore") - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_10_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 0], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_10_1.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 1], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_10_2.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 2], pgxdata) - - def test_ETS_C1P0_p0_11_j2k(self): - jfile = opj_data_file('input/conformance/p0_11.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_11_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - @unittest.skip("fprintf stderr output in r2343.") - def test_ETS_C1P0_p0_12_j2k(self): - jfile = opj_data_file('input/conformance/p0_12.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_12_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - @unittest.skip("fprintf stderr output in r2343.") - def test_ETS_C1P0_p0_13_j2k(self): - jfile = opj_data_file('input/conformance/p0_13.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_13_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 0], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_13_1.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 1], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_13_2.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 2], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_13_3.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 3], pgxdata) - - def test_ETS_C1P0_p0_14_j2k(self): - jfile = opj_data_file('input/conformance/p0_14.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_14_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 0], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_14_1.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 1], pgxdata) - - pgxfile = opj_data_file('baseline/conformance/c1p0_14_2.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata[:, :, 2], pgxdata) - - def test_ETS_C1P0_p0_15_j2k(self): - jfile = opj_data_file('input/conformance/p0_15.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_15_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P0_p0_16_j2k(self): - jfile = opj_data_file('input/conformance/p0_16.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p0_16_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P1_p1_01_j2k(self): - jfile = opj_data_file('input/conformance/p1_01.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p1_01_0.pgx') - pgxdata = read_pgx(pgxfile) - np.testing.assert_array_equal(jpdata, pgxdata) - - def test_ETS_C1P1_p1_02_j2k(self): - jfile = opj_data_file('input/conformance/p1_02.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read(rlevel=0) - - pgxfile = opj_data_file('baseline/conformance/c1p1_02_0.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 5) - self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 0.765) - - pgxfile = opj_data_file('baseline/conformance/c1p1_02_1.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 1], pgxdata) < 4) - self.assertTrue(mse(jpdata[:, :, 1], pgxdata) < 0.616) - - pgxfile = opj_data_file('baseline/conformance/c1p1_02_2.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 2], pgxdata) < 6) - self.assertTrue(mse(jpdata[:, :, 2], pgxdata) < 1.051) - - def test_ETS_C1P1_p1_04_j2k(self): - jfile = opj_data_file('input/conformance/p1_04.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - - pgxfile = opj_data_file('baseline/conformance/c1p1_04_0.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata, pgxdata) < 624) - self.assertTrue(mse(jpdata, pgxdata) < 3080) - - @unittest.skip("fprintf stderr output in r2343.") - def test_ETS_C1P1_p1_05_j2k(self): - jfile = opj_data_file('input/conformance/p1_05.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - - pgxfile = opj_data_file('baseline/conformance/c1p1_05_0.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 40) - self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 8.458) - - pgxfile = opj_data_file('baseline/conformance/c1p1_05_1.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 1], pgxdata) < 40) - self.assertTrue(mse(jpdata[:, :, 1], pgxdata) < 9.816) - - pgxfile = opj_data_file('baseline/conformance/c1p1_05_2.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 2], pgxdata) < 40) - self.assertTrue(mse(jpdata[:, :, 2], pgxdata) < 10.154) - - @unittest.skip("fprintf stderr output in r2343.") - def test_ETS_C1P1_p1_06_j2k(self): - jfile = opj_data_file('input/conformance/p1_06.j2k') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - - pgxfile = opj_data_file('baseline/conformance/c1p1_06_0.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 0], pgxdata) < 2) - self.assertTrue(mse(jpdata[:, :, 0], pgxdata) < 0.6) - - pgxfile = opj_data_file('baseline/conformance/c1p1_06_1.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 1], pgxdata) < 2) - self.assertTrue(mse(jpdata[:, :, 1], pgxdata) < 0.6) - - pgxfile = opj_data_file('baseline/conformance/c1p1_06_2.pgx') - pgxdata = read_pgx(pgxfile) - self.assertTrue(peak_tolerance(jpdata[:, :, 2], pgxdata) < 2) - self.assertTrue(mse(jpdata[:, :, 2], pgxdata) < 0.6) - - def test_ETS_JP2_file1(self): - jfile = opj_data_file('input/conformance/file1.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (512, 768, 3)) - - def test_ETS_JP2_file2(self): - jfile = opj_data_file('input/conformance/file2.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (640, 480, 3)) - - def test_ETS_JP2_file4(self): - jfile = opj_data_file('input/conformance/file4.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (512, 768)) - - def test_ETS_JP2_file5(self): - """ETS_JP2_file5""" - jfile = opj_data_file('input/conformance/file5.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (512, 768, 3)) - - def test_ETS_JP2_file6(self): - """ETS_JP2_file6""" - jfile = opj_data_file('input/conformance/file6.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (512, 768)) - - def test_ETS_JP2_file7(self): - """ETS_JP2_file7""" - jfile = opj_data_file('input/conformance/file7.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (640, 480, 3)) - - def test_ETS_JP2_file8(self): - """ETS_JP2_file8""" - jfile = opj_data_file('input/conformance/file8.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - self.assertEqual(jpdata.shape, (400, 700)) - - def test_ETS_JP2_file9(self): - """ETS_JP2_file9""" - jfile = opj_data_file('input/conformance/file9.jp2') - jp2k = Jp2k(jfile) - jpdata = jp2k.read() - if re.match(r'[01]\.3', OPENJPEG_VERSION): - # Version 1.3 reads in the image as the palette indices. - self.assertEqual(jpdata.shape, (512, 768)) - else: - self.assertEqual(jpdata.shape, (512, 768, 3)) - - def test_NR_DEC_Bretagne2_j2k_1_decode(self): - """test_NR_DEC_Bretagne2_j2k_1_decode""" - jfile = opj_data_file('input/nonregression/Bretagne2.j2k') - jp2 = Jp2k(jfile) - jp2.read() - self.assertTrue(True) - - def test_NR_DEC__00042_j2k_2_decode(self): - """NR_DEC__00042_j2k_2_decode""" - jfile = opj_data_file('input/nonregression/_00042.j2k') - jp2 = Jp2k(jfile) - jp2.read() - self.assertTrue(True) - - @unittest.skip("fprintf stderr output in r2343.") - def test_NR_DEC_123_j2c_3_decode(self): - """NR_DEC_123_j2c_3_decode""" - jfile = opj_data_file('input/nonregression/123.j2c') - jp2 = Jp2k(jfile) - jp2.read() - self.assertTrue(True) - - @unittest.skipIf(sys.hexversion < 0x03020000, - "Uses features introduced in 3.2.") - def test_NR_DEC_broken_jp2_4_decode(self): - """NR_DEC_broken_jp2_4_decode""" - jfile = opj_data_file('input/nonregression/broken.jp2') - with self.assertWarns(UserWarning): - # colr box has bad length. - jp2 = Jp2k(jfile) - with self.assertRaises(ValueError): - jp2.read() - self.assertTrue(True) - - @unittest.skipIf(re.match(r'[01]\.[34]', OPENJPEG_VERSION), - "Segfaults openjpeg 1.4 and earlier.") - def test_NR_DEC_broken2_jp2_5_decode(self): - """NR_DEC_broken2_jp2_5_decode""" - # Null pointer access - jfile = opj_data_file('input/nonregression/broken2.jp2') - with self.assertRaises(ValueError): - with warnings.catch_warnings(): - # Library warning, invalid number of subbands. - warnings.simplefilter("ignore") - Jp2k(jfile).read() - self.assertTrue(True) - - @unittest.skipIf(sys.hexversion < 0x03020000, - "Uses features introduced in 3.2.") - def test_NR_DEC_broken3_jp2_6_decode(self): - """NR_DEC_broken3_jp2_6_decode""" - jfile = opj_data_file('input/nonregression/broken3.jp2') - with self.assertWarns(UserWarning): - # colr box has bad length. - j = Jp2k(jfile) - - with self.assertRaises(ValueError): - j.read() - - @unittest.skipIf(re.match(r'[01]\.[34]', OPENJPEG_VERSION), - "Segfaults openjpeg 1.4 and earlier.") - def test_NR_DEC_broken4_jp2_7_decode(self): - """NR_DEC_broken4_jp2_7_decode""" - # Null pointer access - jfile = opj_data_file('input/nonregression/broken4.jp2') - with self.assertRaises(ValueError): - with warnings.catch_warnings(): - # Library warning, invalid number of subbands. - warnings.simplefilter("ignore") - Jp2k(jfile).read() - self.assertTrue(True) - - @unittest.skip("fprintf stderr output in r2343.") - def test_NR_DEC_bug_j2c_8_decode(self): - """NR_DEC_bug_j2c_8_decode""" - jfile = opj_data_file('input/nonregression/bug.j2c') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_buxI_j2k_9_decode(self): - """NR_DEC_buxI_j2k_9_decode""" - jfile = opj_data_file('input/nonregression/buxI.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_buxR_j2k_10_decode(self): - """NR_DEC_buxR_j2k_10_decode""" - jfile = opj_data_file('input/nonregression/buxR.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_Cannotreaddatawithnosizeknown_j2k_11_decode(self): - """NR_DEC_Cannotreaddatawithnosizeknown_j2k_11_decode""" - relpath = 'input/nonregression/Cannotreaddatawithnosizeknown.j2k' - jfile = opj_data_file(relpath) - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_cthead1_j2k_12_decode(self): - """NR_DEC_cthead1_j2k_12_decode""" - jfile = opj_data_file('input/nonregression/cthead1.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_CT_Phillips_JPEG2K_Decompr_Problem_j2k_13_decode(self): - """NR_DEC_CT_Phillips_JPEG2K_Decompr_Problem_j2k_13_decode""" - relpath = 'input/nonregression/CT_Phillips_JPEG2K_Decompr_Problem.j2k' - jfile = opj_data_file(relpath) - Jp2k(jfile).read() - self.assertTrue(True) - - @unittest.skip("fprintf stderr output in r2343.") - def test_NR_DEC_illegalcolortransform_j2k_14_decode(self): - """Stream too short, expected SOT.""" - jfile = opj_data_file('input/nonregression/illegalcolortransform.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_j2k32_j2k_15_decode(self): - """NR_DEC_j2k32_j2k_15_decode""" - jfile = opj_data_file('input/nonregression/j2k32.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_kakadu_v4_4_openjpegv2_broken_j2k_16_decode(self): - """NR_DEC_kakadu_v4_4_openjpegv2_broken_j2k_16_decode""" - relpath = 'input/nonregression/kakadu_v4-4_openjpegv2_broken.j2k' - jfile = opj_data_file(relpath) - with warnings.catch_warnings(): - # This file has an invalid ICC profile - warnings.simplefilter("ignore") - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_MarkerIsNotCompliant_j2k_17_decode(self): - """NR_DEC_MarkerIsNotCompliant_j2k_17_decode""" - jfile = opj_data_file('input/nonregression/MarkerIsNotCompliant.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_Marrin_jp2_18_decode(self): - """NR_DEC_Marrin_jp2_18_decode""" - jfile = opj_data_file('input/nonregression/Marrin.jp2') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_movie_00000_j2k_20_decode(self): - """test_NR_DEC_movie_00000_j2k_20_decode""" - jfile = opj_data_file('input/nonregression/movie_00000.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_movie_00001_j2k_21_decode(self): - """NR_DEC_movie_00001_j2k_21_decode""" - jfile = opj_data_file('input/nonregression/movie_00001.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_movie_00002_j2k_22_decode(self): - """NR_DEC_movie_00002_j2k_22_decode""" - jfile = opj_data_file('input/nonregression/movie_00002.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_orb_blue_lin_j2k_j2k_23_decode(self): - """NR_DEC_orb_blue_lin_j2k_j2k_23_decode""" - jfile = opj_data_file('input/nonregression/orb-blue10-lin-j2k.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_NR_DEC_orb_blue_win_j2k_j2k_24_decode(self): - """NR_DEC_orb_blue_win_j2k_j2k_24_decode""" - jfile = opj_data_file('input/nonregression/orb-blue10-win-j2k.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_nc_dec_orb_blue_lin_jp2_25_decode(self): - """NR-DEC-orb-blue-lin.jp2-25-decode""" - jfile = opj_data_file('input/nonregression/orb-blue10-lin-jp2.jp2') - with warnings.catch_warnings(): - # This file has an invalid ICC profile - warnings.simplefilter("ignore") - Jp2k(jfile).read() - self.assertTrue(True) - - def test_nr_dec_orb_blue_win_jp2_26_decode(self): - """NR-DEC-orb-blue-win.jp2-26-decode""" - jfile = opj_data_file('input/nonregression/orb-blue10-win-jp2.jp2') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_nr_dec_relax_jp2_27_decode(self): - """NR-DEC-relax.jp2-27-decode""" - jfile = opj_data_file('input/nonregression/relax.jp2') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_nr_dec_test_lossless_j2k_28_decode(self): - """NR-DEC-test-lossless.j2k-28-decode""" - jfile = opj_data_file('input/nonregression/test_lossless.j2k') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_nr_dec_issue104_jpxstream_jp2_33_decode(self): - """NR-DEC-issue104-jpxstream.jp2-33-decode""" - jfile = opj_data_file('input/nonregression/issue104_jpxstream.jp2') - Jp2k(jfile).read() - self.assertTrue(True) - - def test_nr_dec_file_409752_jp2_40_decode(self): - """NR-DEC-file-409752.jp2-40-decode""" - jfile = opj_data_file('input/nonregression/file409752.jp2') - j = Jp2k(jfile) - with self.assertRaises(RuntimeError): - j.read() - if __name__ == "__main__": unittest.main()