Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
pylene
Commits
812c82e8
Commit
812c82e8
authored
Sep 19, 2021
by
Baptiste Esteban
Browse files
Check the exception raised
parent
9f59674c
Pipeline
#30195
failed with stages
in 3 minutes and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pylene/src/io/cfitsio_plugin.cpp
View file @
812c82e8
...
...
@@ -98,7 +98,7 @@ namespace mln::io::fits
int
ndim
;
fits_get_img_dim
(
file
,
&
ndim
,
&
status
);
if
(
ndim
==
0
||
ndim
>
4
)
throw
std
::
runtime_error
(
fmt
::
format
(
"Unhandled image number of dimension (Got {}, expected in [1 - 4]"
,
ndim
));
throw
std
::
runtime_error
(
fmt
::
format
(
"Unhandled image number of dimension (Got {}, expected in [1 - 4]
)
"
,
ndim
));
// Get the dimensions
long
dims
[
4
];
...
...
tests/io/cfitsio.cpp
View file @
812c82e8
...
...
@@ -6,6 +6,8 @@
#include
<gtest/gtest.h>
#include
<cstring>
static
const
auto
filename
=
fixtures
::
ImagePath
::
concat_with_filename
(
"test.fit"
);
TEST
(
IO
,
cfitsio_not_an_image
)
...
...
@@ -16,9 +18,10 @@ TEST(IO, cfitsio_not_an_image)
auto
img
=
mln
::
io
::
fits
::
imread
(
filename
,
0
);
(
void
)
img
;
}
catch
(
std
::
runtime_error
&
)
catch
(
std
::
runtime_error
&
e
)
{
has_raised
=
true
;
ASSERT_TRUE
(
std
::
strcmp
(
"Unhandled image number of dimension (Got 0, expected in [1 - 4])"
,
e
.
what
())
==
0
);
}
ASSERT_TRUE
(
has_raised
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment