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
88af7d91
Unverified
Commit
88af7d91
authored
4 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
[tests] add a failing example for broken conststorageprovider ctor
parent
a176c2a6
No related branches found
No related tags found
2 merge requests
!10
Fix compilation with new clang
,
!8
FIx broken const storage + remove coverage
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/xt/test/common/memory.cc
+19
-1
19 additions, 1 deletion
dune/xt/test/common/memory.cc
with
19 additions
and
1 deletion
dune/xt/test/common/memory.cc
+
19
−
1
View file @
88af7d91
...
...
@@ -21,8 +21,9 @@ using namespace Dune::XT::Common;
struct
ScopeTest
:
public
testing
::
Test
{
typedef
in
t
T
;
us
in
g
T
=
int
;
static
constexpr
T
constant
=
1
;
template
<
class
P
>
void
deref
(
P
&
p
)
{
...
...
@@ -31,6 +32,13 @@ struct ScopeTest : public testing::Test
EXPECT_EQ
(
constant
,
g
);
}
template
<
class
P
>
void
access
(
const
P
&
p
)
{
auto
g
=
p
.
access
();
EXPECT_EQ
(
constant
,
g
);
}
template
<
template
<
class
F
>
class
Provider
,
class
P
>
void
scope
(
P
&
p
)
{
...
...
@@ -46,10 +54,20 @@ struct ScopeTest : public testing::Test
scope
<
StorageProvider
>
(
shared
);
deref
(
shared
);
}
void
check_const
()
{
using
CSP
=
ConstStorageProvider
<
T
>
;
access
(
CSP
{
new
T
(
constant
)});
CSP
{};
T
e
{
constant
};
CSP
{
e
};
}
};
constexpr
typename
ScopeTest
::
T
ScopeTest
::
constant
;
TEST_F
(
ScopeTest
,
All
)
{
this
->
check_shared
();
this
->
check_const
();
}
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