diff options
author | Sam Gross <colesbury@gmail.com> | 2015-08-17 20:47:17 +0300 |
---|---|---|
committer | Sam Gross <colesbury@gmail.com> | 2015-08-17 20:47:17 +0300 |
commit | 869978fd4152a7605815f5d2c8c54066fa3fec16 (patch) | |
tree | 0a0cecb15cf7d479e05d1993d95c63545dd46cad /test | |
parent | 5c2e963f4cca3a6c76dc75d0d7503d77dee57d4f (diff) |
Support saving torch.ByteTensor images
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_decompress_jpg.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_decompress_jpg.lua b/test/test_decompress_jpg.lua index a64a443..5728eaf 100755 --- a/test/test_decompress_jpg.lua +++ b/test/test_decompress_jpg.lua @@ -51,9 +51,11 @@ function test.LoadInvalid() local img_binary = torch.rand(file_size_bytes):mul(255):byte() -- Now decompress the image from the ByteTensor - local img_from_tensor = image.decompressJPG(img_binary) + local ok, img_from_tensor = pcall(function() + return image.decompressJPG(img_binary) + end) - mytester:assert(img_from_tensor == nil, + mytester:assert(not ok or img_from_tensor == nil, 'A non-nil was returned on an invalid input! ') end |