Python aifc._HUGE_VAL Examples
The following are 9
code examples of aifc._HUGE_VAL().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
aifc
, or try the search function
.
Example #1
Source File: test_aifc.py From ironpython2 with Apache License 2.0 | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in ('', 'foo', 'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #2
Source File: test_aifc.py From BinderFilter with MIT License | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in (b'', b'foo', b'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #3
Source File: test_aifc.py From oss-ftp with MIT License | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in ('', 'foo', 'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #4
Source File: test_aifc.py From Fluid-Designer with GNU General Public License v3.0 | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in (b'', b'foo', b'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #5
Source File: test_aifc.py From ironpython3 with Apache License 2.0 | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in (b'', b'foo', b'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #6
Source File: test_aifc.py From gcblue with BSD 3-Clause "New" or "Revised" License | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in ('', 'foo', 'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #7
Source File: test_aifc.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in (b'', b'foo', b'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #8
Source File: test_aifc.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in (b'', b'foo', b'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)
Example #9
Source File: test_aifc.py From CTFCrackTools with GNU General Public License v3.0 | 6 votes |
def test_read_written(self): def read_written(self, what): f = io.BytesIO() getattr(aifc, '_write_' + what)(f, x) f.seek(0) return getattr(aifc, '_read_' + what)(f) for x in (-1, 0, 0.1, 1): self.assertEqual(read_written(x, 'float'), x) for x in (float('NaN'), float('Inf')): self.assertEqual(read_written(x, 'float'), aifc._HUGE_VAL) for x in (b'', b'foo', b'a' * 255): self.assertEqual(read_written(x, 'string'), x) for x in (-0x7FFFFFFF, -1, 0, 1, 0x7FFFFFFF): self.assertEqual(read_written(x, 'long'), x) for x in (0, 1, 0xFFFFFFFF): self.assertEqual(read_written(x, 'ulong'), x) for x in (-0x7FFF, -1, 0, 1, 0x7FFF): self.assertEqual(read_written(x, 'short'), x) for x in (0, 1, 0xFFFF): self.assertEqual(read_written(x, 'ushort'), x)