summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-07-14 13:20:49 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-07-14 13:20:49 +0200
commit6f45f8555be7bef45b7c50a95b898ebba7fb9a92 (patch)
treef2f7c24b74d647db470002974f38af14fff8bc8f /test
parentec67a7720a236918188b384c95631c4a5f1abb3c (diff)
w
Diffstat (limited to 'test')
-rw-r--r--test/bptr.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/bptr.cpp b/test/bptr.cpp
index 3a62de53..12bd9442 100644
--- a/test/bptr.cpp
+++ b/test/bptr.cpp
@@ -8,7 +8,13 @@
namespace floormat {
namespace {
-struct Foo : bptr_base {};
+struct Foo : bptr_base
+{
+ int x;
+
+ fm_DECLARE_DELETED_COPY_MOVE_ASSIGNMENTS(Foo);
+ Foo(int x) : x{x} {}
+};
struct Bar : Foo {};
struct Baz : bptr_base {};
} // namespace
@@ -334,6 +340,17 @@ void test10()
fm_assert(bptr<Foo>{} == bptr<Foo>{});
fm_assert(bptr<const Foo>{} == bptr<const Foo>{});
fm_assert(bptr<Foo>{} == bptr<const Foo>{});
+
+ auto p1 = bptr<const Foo>{InPlace, 1}; (void)p1;
+ //auto p2 = bptr<Foo>{p1};
+ auto p3 = bptr<const Foo>{p1}; (void)p3;
+ fm_assert(p1->x == 1); fm_assert(p3->x == 1);
+ fm_assert(p1 == p3);
+
+ auto p4 = bptr<Foo>{InPlace, 4}; (void)p4;
+ auto p5 = bptr<const Foo>{p4}; (void)p5;
+ fm_assert(p4->x == 4); fm_assert(p5->x == 4);
+ fm_assert(p4 == p5);
}
} // namespace