diff options
author | Hubert Figuiere <hub@figuiere.net> | 2010-11-16 00:18:51 -0800 |
---|---|---|
committer | Hubert Figuiere <hub@figuiere.net> | 2010-11-16 00:18:51 -0800 |
commit | 01e5689267d87e0e08ea7aeb9209a371a1a0d196 (patch) | |
tree | 861628689b24cff335a2a2f33716ac8d5b9f3bde /test | |
parent | e6af6e1654588a0effdf25767d3d457e091792c0 (diff) |
unpack now reports an error when there is a decompression error.
Diffstat (limited to 'test')
-rwxr-xr-x | test/testunpack.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/testunpack.cpp b/test/testunpack.cpp index 656b95f..79cd54e 100755 --- a/test/testunpack.cpp +++ b/test/testunpack.cpp @@ -36,9 +36,11 @@ int test_unpack() OpenRaw::Internals::Unpack unpack(32, OpenRaw::Internals::IFD::COMPRESS_NIKON_PACK); - size_t s = unpack.unpack_be12to16((uint8_t*)unpacked, 40, packed, - sizeof(packed)); + size_t s; + or_error err = unpack.unpack_be12to16((uint8_t*)unpacked, 40, packed, + sizeof(packed), s); BOOST_CHECK(s = size_t(sizeof(unpacked))); + BOOST_CHECK(err == OR_ERROR_NONE); for (size_t i = 0; i < 2; ++i) { BOOST_CHECK(unpacked[10 * i + 0] == 0x0123); BOOST_CHECK(unpacked[10 * i + 1] == 0x0456); @@ -62,9 +64,11 @@ int test_unpack2() OpenRaw::Internals::Unpack unpack(32, OpenRaw::Internals::IFD::COMPRESS_NONE); - size_t s = unpack.unpack_be12to16((uint8_t*)unpacked, 4, packed, - sizeof(packed)); + size_t s; + or_error err = unpack.unpack_be12to16((uint8_t*)unpacked, 4, packed, + sizeof(packed), s); BOOST_CHECK(s == size_t(sizeof(unpacked))); + BOOST_CHECK(err == OR_ERROR_NONE); BOOST_CHECK(unpacked[0] == 0x0123); BOOST_CHECK(unpacked[1] == 0x0456); return 0; |