Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Migliore
VTK
Commits
fcce989b
Commit
fcce989b
authored
2 years ago
by
Spiros Tsalikis
Browse files
Options
Downloads
Patches
Plain Diff
Add Test for mapComponent in TestImplicitArrayTraits
parent
c5a96ed5
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Common/ImplicitArrays/Testing/Cxx/TestImplicitArrayTraits.cxx
+89
-2
89 additions, 2 deletions
...on/ImplicitArrays/Testing/Cxx/TestImplicitArrayTraits.cxx
with
89 additions
and
2 deletions
Common/ImplicitArrays/Testing/Cxx/TestImplicitArrayTraits.cxx
+
89
−
2
View file @
fcce989b
...
...
@@ -39,6 +39,13 @@ struct HasMapAndMapTuple
void
mapTuple
(
int
,
float
*
tuple
)
const
{
tuple
[
0
]
=
tuple
[
1
]
=
tuple
[
2
]
=
0.0
;
}
};
struct
HasMapAndMapComponent
{
float
map
(
int
)
const
{
return
0.0
;
}
float
mapComponent
(
int
,
int
)
const
{
return
0.0
;
}
};
struct
IsClosure
{
float
operator
()(
int
)
const
{
return
0.0
;
}
...
...
@@ -76,6 +83,12 @@ int TestImplicitArrayTraits(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
result
=
EXIT_FAILURE
;
}
if
(
vtk
::
detail
::
can_map_component_trait
<::
HasNothing
>::
value
)
{
std
::
cout
<<
"Failed can_map_component_trait check on HasNothing"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
static_assert
(
!
vtk
::
detail
::
is_closure_trait
<::
HasNothing
>::
value
,
"HasNothing being attributed a is_closure_trait"
);
if
(
vtk
::
detail
::
is_closure_trait
<::
HasNothing
>::
value
)
...
...
@@ -135,6 +148,12 @@ int TestImplicitArrayTraits(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
result
=
EXIT_FAILURE
;
}
if
(
vtk
::
detail
::
can_map_component_trait
<::
HasMap
>::
value
)
{
std
::
cout
<<
"Failed can_map_component_trait check on HasMap"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
vtk
::
detail
::
implicit_array_traits
<::
HasMap
>::
can_read
)
{
std
::
cout
<<
"Failed can_read check on HasMap"
<<
std
::
endl
;
...
...
@@ -161,12 +180,12 @@ int TestImplicitArrayTraits(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
//--------------------------------------------------------------------------------
static_assert
(
vtk
::
detail
::
has_map_trait
<::
HasMapAndMapTuple
>::
value
,
"HasMap is not being attributed a has_map_trait"
);
"HasMap
AndMapTuple
is not being attributed a has_map_trait"
);
static_assert
(
vtk
::
detail
::
has_map_tuple_trait
<::
HasMapAndMapTuple
>::
value
,
"HasMapAndMapTuple is not being attributed a has_map_tuple_trait"
);
if
(
!
vtk
::
detail
::
has_map_tuple_trait
<::
HasMapAndMapTuple
>::
value
)
{
std
::
cout
<<
"Failed has_map_trait check on HasMap"
<<
std
::
endl
;
std
::
cout
<<
"Failed has_map_trait check on HasMap
AndMapTuple
"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
...
...
@@ -182,6 +201,12 @@ int TestImplicitArrayTraits(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
result
=
EXIT_FAILURE
;
}
if
(
vtk
::
detail
::
can_map_component_trait
<::
HasMapAndMapTuple
>::
value
)
{
std
::
cout
<<
"Failed can_map_component_trait check on HasMapAndMapTuple"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
vtk
::
detail
::
implicit_array_traits
<::
HasMapAndMapTuple
>::
can_read
)
{
std
::
cout
<<
"Failed can_read check on HasMapAndMapTuple"
<<
std
::
endl
;
...
...
@@ -207,6 +232,62 @@ int TestImplicitArrayTraits(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
result
=
EXIT_FAILURE
;
}
//--------------------------------------------------------------------------------
static_assert
(
vtk
::
detail
::
has_map_trait
<::
HasMapAndMapComponent
>::
value
,
"HasMapAndMapComponent is not being attributed a has_map_trait"
);
static_assert
(
vtk
::
detail
::
has_map_component_trait
<::
HasMapAndMapComponent
>::
value
,
"HasMapAndMapComponent is not being attributed a has_map_component_trait"
);
if
(
vtk
::
detail
::
has_map_tuple_trait
<::
HasMapAndMapComponent
>::
value
)
{
std
::
cout
<<
"Failed has_map_trait check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
vtk
::
detail
::
can_map_trait
<::
HasMapAndMapComponent
>::
value
)
{
std
::
cout
<<
"Failed can_map_trait check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
vtk
::
detail
::
can_map_tuple_trait
<::
HasMapAndMapComponent
>::
value
)
{
std
::
cout
<<
"Failed can_map_tuple_trait check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
vtk
::
detail
::
can_map_component_trait
<::
HasMapAndMapComponent
>::
value
)
{
std
::
cout
<<
"Failed can_map_component_trait check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
vtk
::
detail
::
implicit_array_traits
<::
HasMapAndMapComponent
>::
can_read
)
{
std
::
cout
<<
"Failed can_read check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
std
::
is_same
<
vtk
::
detail
::
implicit_array_traits
<::
HasMapAndMapComponent
>::
rtype
,
float
>::
value
)
{
std
::
cout
<<
"Failed rtype check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
std
::
is_same
<
vtk
::
detail
::
implicit_array_traits
<::
HasMapAndMapComponent
>::
type
,
::
HasMapAndMapComponent
>::
value
)
{
std
::
cout
<<
"Failed type check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
vtk
::
detail
::
implicit_array_traits
<::
HasMapAndMapComponent
>::
code
!=
vtk
::
detail
::
iarrays
::
MAP
)
{
std
::
cout
<<
"Failed code check on HasMapAndMapComponent"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
//--------------------------------------------------------------------------------
static_assert
(
vtk
::
detail
::
is_closure_trait
<::
IsClosure
>::
value
,
"IsClosure is not being attributed a is_closure_trait"
);
...
...
@@ -228,6 +309,12 @@ int TestImplicitArrayTraits(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
result
=
EXIT_FAILURE
;
}
if
(
vtk
::
detail
::
can_map_component_trait
<::
IsClosure
>::
value
)
{
std
::
cout
<<
"Failed can_map_component_trait check on IsClosure"
<<
std
::
endl
;
result
=
EXIT_FAILURE
;
}
if
(
!
vtk
::
detail
::
implicit_array_traits
<::
IsClosure
>::
can_read
)
{
std
::
cout
<<
"Failed can_read check on IsClosure"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment