Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
bfbaaa89
Commit
bfbaaa89
authored
4 years ago
by
Tobias Leibner
Browse files
Options
Downloads
Patches
Plain Diff
[test] fix tests in release mode
parent
72f039ec
No related branches found
No related tags found
1 merge request
!41
Fix compilation with icc, several other changes
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/xt/test/common/crtp.cc
+3
-0
3 additions, 0 deletions
dune/xt/test/common/crtp.cc
dune/xt/test/common/fmatrix.cc
+3
-2
3 additions, 2 deletions
dune/xt/test/common/fmatrix.cc
dune/xt/test/common/fvector.cc
+6
-0
6 additions, 0 deletions
dune/xt/test/common/fvector.cc
with
12 additions
and
2 deletions
dune/xt/test/common/crtp.cc
+
3
−
0
View file @
bfbaaa89
...
...
@@ -75,6 +75,8 @@ struct TestImp : public TestInterface<ImpTraits>
}
};
// If NDEBUG is defined, the CHECK_CRTP macro does nothing, so the code below will not throw
#ifndef NDEBUG
GTEST_TEST
(
crtp
,
fail
)
{
TestInterface
<
FailTraits
>
test_iface
;
...
...
@@ -85,6 +87,7 @@ GTEST_TEST(crtp, fail)
},
Dune
::
XT
::
Common
::
Exceptions
::
CRTP_check_failed
);
}
#endif // NDEBUG
GTEST_TEST
(
crtp
,
success
)
{
...
...
This diff is collapsed.
Click to expand it.
dune/xt/test/common/fmatrix.cc
+
3
−
2
View file @
bfbaaa89
...
...
@@ -31,14 +31,15 @@ GTEST_TEST(dune_xt_common_field_matrix, creation_and_calculations)
ScalarMatrixType
one
(
1.
);
ScalarMatrixType
one2
{
1.
};
MatrixType
mat
({{
0.
,
1.
,
2.
},
{
3.
,
4.
,
5.
}});
// If NDEBUG is defined, the input is not checked in the constructor
#ifndef NDEBUG
EXPECT_ANY_THROW
(
MatrixType
({{
0.
,
2.
},
{
3.
,
4.
,
5.
}}));
EXPECT_ANY_THROW
(
MatrixType
({{
0.
,
1.
,
2.
},
{
4.
,
5.
}}));
EXPECT_ANY_THROW
(
MatrixType
({{
0.
,
2.
},
{
4.
,
5.
}}));
EXPECT_ANY_THROW
(
ScalarMatrixType
({{
0.
,
2.
},
{
4.
,
5.
}}));
#ifdef NDEBUG
EXPECT_ANY_THROW
(
MatrixType
(
rows
+
1
,
cols
-
1
,
1.
));
EXPECT_ANY_THROW
(
ScalarMatrixType
(
2
,
3
,
1.
));
#endif
#endif
// NDEBUG
EXPECT_EQ
(
zero
[
0
][
0
],
0.
);
EXPECT_EQ
(
one
[
0
][
0
],
1.
);
EXPECT_EQ
(
one2
[
0
][
0
],
1.
);
...
...
This diff is collapsed.
Click to expand it.
dune/xt/test/common/fvector.cc
+
6
−
0
View file @
bfbaaa89
...
...
@@ -34,7 +34,10 @@ GTEST_TEST(dune_xt_common_field_vector, creation_and_calculations)
VectorType
test_vec
{
0
,
1
,
2
,
3
};
for
(
size_t
ii
=
0
;
ii
<
4
;
++
ii
)
EXPECT_EQ
(
test_vec
[
ii
],
ii
);
// If NDEBUG is defined, the input is not checked in the constructor
#ifndef NDEBUG
EXPECT_ANY_THROW
(
VectorType
({
1
,
2
,
3
}));
#endif
VectorType
copy_assigned
=
test_vec
;
check
(
copy_assigned
,
test_vec
);
VectorType
copy_constructed
(
test_vec
);
...
...
@@ -45,8 +48,11 @@ GTEST_TEST(dune_xt_common_field_vector, creation_and_calculations)
std
::
vector
<
double
>
std_vec2
=
test_vec
;
for
(
size_t
ii
=
0
;
ii
<
4
;
++
ii
)
EXPECT_EQ
(
std_vec2
[
ii
],
ii
);
// If NDEBUG is defined, the input is not checked in the constructor
#ifndef NDEBUG
std_vec
.
resize
(
2
);
EXPECT_ANY_THROW
(
VectorType
{
std_vec
});
#endif
BaseVectorType
base_vec
{
0
,
1
,
2
,
3
};
VectorType
constructed_from_base
(
base_vec
);
check
(
constructed_from_base
,
test_vec
);
...
...
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