Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
d487b755
Commit
d487b755
authored
Oct 29, 2018
by
Julien Michel
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TEST: Static checks for test
parent
0693ea95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
13 deletions
+62
-13
Modules/Filtering/ImageManipulation/test/otbFunctorImageFilter.cxx
...iltering/ImageManipulation/test/otbFunctorImageFilter.cxx
+62
-13
No files found.
Modules/Filtering/ImageManipulation/test/otbFunctorImageFilter.cxx
View file @
d487b755
...
...
@@ -28,6 +28,68 @@
#include <numeric>
#include <complex>
// static tests
// Tests of IsNeighborhood, PixelTypeDeduction and ImageTypeDeduction structs
using
namespace
otb
;
template
<
typename
T
>
struct
TypesCheck
{
using
ScalarType
=
T
;
using
ImageType
=
otb
::
Image
<
T
>
;
using
ComplexType
=
std
::
complex
<
ScalarType
>
;
using
ComplexImageType
=
otb
::
Image
<
ComplexType
>
;
using
VectorType
=
itk
::
VariableLengthVector
<
ScalarType
>
;
using
VectorImageType
=
otb
::
VectorImage
<
ScalarType
>
;
using
ComplexVectorType
=
itk
::
VariableLengthVector
<
ComplexType
>
;
using
ComplexVectorImageType
=
otb
::
VectorImage
<
ComplexType
>
;
using
NeighborhoodType
=
itk
::
Neighborhood
<
ScalarType
>
;
using
ComplexNeighborhoodType
=
itk
::
Neighborhood
<
ComplexType
>
;
using
VectorNeighborhoodType
=
itk
::
Neighborhood
<
VectorType
>
;
using
ComplexVectorNeighborhoodType
=
itk
::
Neighborhood
<
ComplexVectorType
>
;
static_assert
(
!
otb
::
IsNeighborhood
<
ScalarType
>::
value
,
""
);
static_assert
(
!
otb
::
IsNeighborhood
<
ComplexType
>::
value
,
""
);
static_assert
(
!
otb
::
IsNeighborhood
<
VectorType
>::
value
,
""
);
static_assert
(
!
otb
::
IsNeighborhood
<
ComplexVectorType
>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
NeighborhoodType
>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
ComplexNeighborhoodType
>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
VectorNeighborhoodType
>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
ComplexVectorNeighborhoodType
>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
const
NeighborhoodType
&>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
const
ComplexNeighborhoodType
&>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
const
VectorNeighborhoodType
&>::
value
,
""
);
static_assert
(
otb
::
IsNeighborhood
<
const
ComplexVectorNeighborhoodType
&>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
ScalarType
>::
PixelType
,
ScalarType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
ComplexType
>::
PixelType
,
ComplexType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
VectorType
>::
PixelType
,
VectorType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
ComplexVectorType
>::
PixelType
,
ComplexVectorType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
NeighborhoodType
>::
PixelType
,
ScalarType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
ComplexNeighborhoodType
>::
PixelType
,
ComplexType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
VectorNeighborhoodType
>::
PixelType
,
VectorType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
ComplexVectorNeighborhoodType
>::
PixelType
,
ComplexVectorType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
const
NeighborhoodType
&>::
PixelType
,
ScalarType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
const
ComplexNeighborhoodType
&>::
PixelType
,
ComplexType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
const
VectorNeighborhoodType
&>::
PixelType
,
VectorType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
PixelTypeDeduction
<
const
ComplexVectorNeighborhoodType
&>::
PixelType
,
ComplexVectorType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
ScalarType
>::
ImageType
,
ImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
ComplexType
>::
ImageType
,
ComplexImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
VectorType
>::
ImageType
,
VectorImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
ComplexVectorType
>::
ImageType
,
ComplexVectorImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
const
ScalarType
&>::
ImageType
,
ImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
const
ComplexType
&>::
ImageType
,
ComplexImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
const
VectorType
&>::
ImageType
,
VectorImageType
>::
value
,
""
);
static_assert
(
std
::
is_same
<
typename
ImageTypeDeduction
<
const
ComplexVectorType
&>::
ImageType
,
ComplexVectorImageType
>::
value
,
""
);
};
auto
checksDouble
=
TypesCheck
<
double
>
{};
// Example functors
// N scalar images -> image
...
...
@@ -197,19 +259,6 @@ template<typename T> struct VectorModulus
}
};
// Tests of IsNeighborhood struct
using
OImage
=
typename
otb
::
Image
<
int
>
;
using
Neig
=
typename
itk
::
Neighborhood
<
int
>
;
static_assert
(
otb
::
IsNeighborhood
<
Neig
>::
value
,
"err"
);
static_assert
(
!
otb
::
IsNeighborhood
<
double
>::
value
,
"err"
);
static_assert
(
!
otb
::
IsNeighborhood
<
itk
::
VariableLengthVector
<
double
>>::
value
,
"err"
);
using
namespace
otb
::
functor_filter_details
;
using
namespace
otb
;
int
otbFunctorImageFilter
(
int
itkNotUsed
(
argc
),
char
*
itkNotUsed
(
argv
)
[])
{
// test functions in functor_filter_details namespace
...
...
Julien Michel
@jmichel
mentioned in commit
ba576452
·
Nov 19, 2018
mentioned in commit
ba576452
mentioned in commit ba5764527a25d049ba6e9ab4074b930d1f00962c
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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