diff --git a/tasks/tests/deque_test.cpp b/tasks/tests/deque_test.cpp index 04860e2..c6909f8 100644 --- a/tasks/tests/deque_test.cpp +++ b/tasks/tests/deque_test.cpp @@ -212,7 +212,16 @@ struct NotDefaultConstructible { int x = 0; }; +struct NotCopyable { + NotCopyable() = default; + NotCopyable(const NotCopyable&) = delete; +}; + void test6() { + { + Deque deq(10); + } + Deque d; NotDefaultConstructible ndc = VerySpecialType(-1); diff --git a/tasks/tests/smartpointers_test.cpp b/tasks/tests/smartpointers_test.cpp index ca57b6b..67b9701 100644 --- a/tasks/tests/smartpointers_test.cpp +++ b/tasks/tests/smartpointers_test.cpp @@ -36,6 +36,22 @@ struct Derived: public Base {}; void test_shared_ptr() { + { + auto empty = SharedPtr(); + SharedPtr ptr = empty; + auto empty2 = SharedPtr(); + auto ptr2 = empty2; + std::ignore = ptr2; + } + + { + auto ptr = makeShared(1); + auto ptr2 = std::move(ptr); + // test nullptr checking presence + assert(ptr.use_count() == 0); + auto wptr = WeakPtr(ptr); + assert(wptr.expired()); + } using std::vector;