diff --git a/hdf5plugin/test.py b/hdf5plugin/test.py index 4c6fbe97..b4fbb685 100644 --- a/hdf5plugin/test.py +++ b/hdf5plugin/test.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2019 European Synchrotron Radiation Facility +# Copyright (c) 2019-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -72,8 +72,11 @@ def _test(self, filter_name, dtype=numpy.int32, **options): plist = f['data'].id.get_create_plist() filters = [plist.get_filter(i) for i in range(plist.get_nfilters())] f.close() - - self.assertTrue(numpy.array_equal(saved, data)) + + if filter_name in ['zfp']: + self.assertTrue(numpy.allclose(saved, data)) + else: + self.assertTrue(numpy.array_equal(saved, data)) self.assertEqual(saved.dtype, data.dtype) self.assertEqual(len(filters), 1) @@ -128,7 +131,8 @@ def testFciDecomp(self): def testZfp(self): """Write/read test with zfp filter plugin""" - self._test('zfp') + self._test('zfp', dtype=numpy.float32) + self._test('zfp', dtype=numpy.float64) def suite(): test_suite = unittest.TestSuite()