Index: uspace/lib/cpp/Makefile
===================================================================
--- uspace/lib/cpp/Makefile	(revision 3adbbda94c3c30b3666802ce4ee4f577b3ea40d7)
+++ uspace/lib/cpp/Makefile	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
@@ -61,4 +61,6 @@
 	src/internal/test/deque.cpp \
 	src/internal/test/map.cpp \
+	src/internal/test/memory.cpp \
+	src/internal/test/mock.cpp \
 	src/internal/test/numeric.cpp \
 	src/internal/test/set.cpp \
Index: uspace/lib/cpp/include/internal/test/mock.hpp
===================================================================
--- uspace/lib/cpp/include/internal/test/mock.hpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
+++ uspace/lib/cpp/include/internal/test/mock.hpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017 Jaroslav Jindrak
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LIBCPP_INTERNAL_TEST_MOCK
+#define LIBCPP_INTERNAL_TEST_MOCK
+
+#include <cstdlib>
+#include <tuple>
+
+namespace std::test
+{
+    /**
+     * Auxiliary type that lets us to monitor the number
+     * of calls to various functions for the purposes
+     * of testing smart pointers and other features of
+     * the library.
+     */
+    struct mock
+    {
+        static size_t constructor_calls;
+        static size_t copy_constructor_calls;
+        static size_t destructor_calls;
+        static size_t move_constructor_calls;
+
+        mock()
+        {
+            ++constructor_calls;
+        }
+
+        mock(const mock&)
+        {
+            ++copy_constructor_calls;
+        }
+
+        mock(mock&&)
+        {
+            ++move_constructor_calls;
+        }
+
+        ~mock()
+        {
+            ++destructor_calls;
+        }
+
+        static void clear()
+        {
+            constructor_calls = size_t{};
+            copy_constructor_calls = size_t{};
+            destructor_calls = size_t{};
+            move_constructor_calls = size_t{};
+        }
+    };
+}
+
+#endif
Index: uspace/lib/cpp/include/internal/test/tests.hpp
===================================================================
--- uspace/lib/cpp/include/internal/test/tests.hpp	(revision 3adbbda94c3c30b3666802ce4ee4f577b3ea40d7)
+++ uspace/lib/cpp/include/internal/test/tests.hpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
@@ -243,4 +243,14 @@
             void test_stack();
     };
+
+    class memory_test: public test_suite
+    {
+        public:
+            bool run(bool) override;
+            const char* name() override;
+
+        private:
+            void test_unique_ptr();
+    };
 }
 
Index: uspace/lib/cpp/src/internal/test/memory.cpp
===================================================================
--- uspace/lib/cpp/src/internal/test/memory.cpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
+++ uspace/lib/cpp/src/internal/test/memory.cpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018 Jaroslav Jindrak
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <initializer_list>
+#include <internal/test/mock.hpp>
+#include <internal/test/tests.hpp>
+#include <memory>
+#include <utility>
+
+namespace std::test
+{
+    bool memory_test::run(bool report)
+    {
+        report_ = report;
+        start();
+
+        test_unique_ptr();
+
+        return end();
+    }
+
+    const char* memory_test::name()
+    {
+        return "memory";
+    }
+
+    void memory_test::test_unique_ptr()
+    {
+        mock::clear();
+        {
+            auto ptr = std::make_unique<mock>();
+            test_eq("unique_ptr get() when non-null", (ptr.get() != nullptr), true);
+            test_eq("unique_ptr operator bool when non-null", (bool)ptr, true);
+        }
+        test_eq("unique_ptr make_unique", mock::constructor_calls, 1U);
+        test_eq("unique_ptr out of scope", mock::destructor_calls, 1U);
+
+        mock::clear();
+        {
+            auto ptr = std::make_unique<mock>();
+            delete ptr.release();
+        }
+        test_eq("unique_ptr release", mock::destructor_calls, 1U);
+
+        mock::clear();
+        {
+            auto ptr = std::make_unique<mock>();
+            ptr.reset(new mock{});
+        }
+        test_eq("unique_ptr reset", mock::destructor_calls, 2U);
+
+        mock::clear();
+        {
+            std::unique_ptr<mock> ptr1{};
+            test_eq("unique_ptr get() when null", ptr1.get(), nullptr);
+            test_eq("unique_ptr operator bool when null", (bool)ptr1, false);
+            {
+                auto ptr2 = std::make_unique<mock>();
+                ptr1 = std::move(ptr2);
+            }
+            test_eq("unique_ptr move pt1", mock::destructor_calls, 0U);
+        }
+        test_eq("unique_ptr move pt2", mock::destructor_calls, 1U);
+    }
+}
Index: uspace/lib/cpp/src/internal/test/mock.cpp
===================================================================
--- uspace/lib/cpp/src/internal/test/mock.cpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
+++ uspace/lib/cpp/src/internal/test/mock.cpp	(revision 83493341b846213db2a5362d46c44971a2c9c2f1)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2018 Jaroslav Jindrak
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <internal/test/mock.hpp>
+
+namespace std::test
+{
+    size_t mock::constructor_calls{};
+    size_t mock::copy_constructor_calls{};
+    size_t mock::destructor_calls{};
+    size_t mock::move_constructor_calls{};
+}
