Skip to content
Snippets Groups Projects
Unverified Commit 88af7d91 authored by René Fritze's avatar René Fritze
Browse files

[tests] add a failing example for broken conststorageprovider ctor

parent a176c2a6
No related branches found
No related tags found
2 merge requests!10Fix compilation with new clang,!8FIx broken const storage + remove coverage
......@@ -21,8 +21,9 @@ using namespace Dune::XT::Common;
struct ScopeTest : public testing::Test
{
typedef int T;
using 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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment