Skip to content

Commit

Permalink
Add tests for all sizes of integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodar01 committed Dec 10, 2024
1 parent cc96392 commit d78e451
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pytest]
minversion = 6.0.0
addopts = -v --tb=long --show-capture=all --capture=no --color=yes --code-highlight=yes
addopts = -q --tb=long --show-capture=all --capture=no --color=yes --code-highlight=yes
log_cli_level = 10
testpaths =
./tests/frontend
Expand Down
108 changes: 108 additions & 0 deletions tests/core/core/reader/test__reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,114 @@ def idfn(fixture_value):
"start": 0,
"stop": 1,
},
{
"img_ext": "tiff",
"img_name": "uint16_full_range",
"dtype": "uint16",
"divisor": numpy.float32(2**16-1),
"shift": 0,
"start": numpy.iinfo("uint16").min,
"stop": numpy.iinfo("uint16").max,
},
{
"img_ext": "tiff",
"img_name": "uint16_partial_range",
"dtype": "uint16",
"divisor": numpy.float32(2**16-1),
"shift": 0,
"start": 255,
"stop": 10_000,
},
{
"img_ext": "tiff",
"img_name": "uint16_smallest_range",
"dtype": "uint16",
"divisor": numpy.float32(2**16-1),
"shift": 0,
"start": 0,
"stop": 1,
},
{
"img_ext": "tiff",
"img_name": "int16_full_range",
"dtype": "int16",
"divisor": numpy.float32(2**16-1),
"shift": numpy.iinfo("int16").min,
"start": numpy.iinfo("int16").min,
"stop": numpy.iinfo("int16").max,
},
{
"img_ext": "tiff",
"img_name": "int16_partial_range",
"dtype": "int16",
"divisor": numpy.float32(2**16-1),
"shift": numpy.iinfo("int16").min,
"start": -10,
"stop": 10,
},
{
"img_ext": "tiff",
"img_name": "int16_smallest_range",
"dtype": "int16",
"divisor": numpy.float32(2**16-1),
"shift": numpy.iinfo("int16").min,
"start": 0,
"stop": 1,
},
{
"img_ext": "tiff",
"img_name": "uint32_full_range",
"dtype": "uint32",
"divisor": numpy.float32(2**32-1),
"shift": 0,
"start": numpy.iinfo("uint32").min,
"stop": numpy.iinfo("uint32").max,
},
{
"img_ext": "tiff",
"img_name": "uint32_partial_range",
"dtype": "uint32",
"divisor": numpy.float32(2**32-1),
"shift": 0,
"start": 65535,
"stop": 1_000_000_000,
},
{
"img_ext": "tiff",
"img_name": "uint32_smallest_range",
"dtype": "uint32",
"divisor": numpy.float32(2**32-1),
"shift": 0,
"start": 0,
"stop": 1,
},
{
"img_ext": "tiff",
"img_name": "int32_full_range",
"dtype": "int32",
"divisor": numpy.float32(2**32-1),
"shift": numpy.iinfo("int32").min,
"start": numpy.iinfo("int32").min,
"stop": numpy.iinfo("int32").max,
},
{
"img_ext": "tiff",
"img_name": "int32_partial_range",
"dtype": "int32",
"divisor": numpy.float32(2**32-1),
"shift": numpy.iinfo("int32").min,
"start": -65_536,
"stop": 65_536,
},
{
"img_ext": "tiff",
"img_name": "int32_smallest_range",
"dtype": "int32",
"divisor": numpy.float32(2**32-1),
"shift": numpy.iinfo("int32").min,
"start": 0,
"stop": 1,
},
])
def monochrome_image(request):
shift = request.param["shift"]
Expand Down

0 comments on commit d78e451

Please sign in to comment.