summaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/weakref/weakref_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vespalib/src/tests/weakref/weakref_test.cpp')
-rw-r--r--vespalib/src/tests/weakref/weakref_test.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/vespalib/src/tests/weakref/weakref_test.cpp b/vespalib/src/tests/weakref/weakref_test.cpp
deleted file mode 100644
index bf85edbc15f..00000000000
--- a/vespalib/src/tests/weakref/weakref_test.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-#include <vespa/vespalib/util/weakref.h>
-#include <vespa/vespalib/testkit/testapp.h>
-
-using vespalib::WeakRef;
-
-class Test : public vespalib::TestApp
-{
-public:
- int getFive() { return 5; }
- void testSimple();
- int Main() override;
-};
-
-
-void
-Test::testSimple()
-{
- WeakRef<Test>::Owner owner(this);
- WeakRef<Test> ref(owner);
- {
- WeakRef<Test>::Usage use(ref);
- ASSERT_TRUE(use.valid());
- EXPECT_TRUE(use->getFive() == 5);
- }
- owner.clear();
- {
- WeakRef<Test>::Usage use(ref);
- EXPECT_TRUE(!use.valid());
- }
-}
-
-
-int
-Test::Main()
-{
- TEST_INIT("weakref_test");
- testSimple();
- TEST_DONE();
-}
-
-TEST_APPHOOK(Test)