From df8536c097af10891b3fbcc099410a2adc8fd2ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Thu, 27 Sep 2018 18:54:39 +0900 Subject: [PATCH] [coco] Test Conv2D's destructor (#1652) This commit introduces a test for Conv2D's destructor. Signed-off-by: Jonghyun Park --- contrib/coco/core/src/IR/Conv2D.test.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contrib/coco/core/src/IR/Conv2D.test.cpp b/contrib/coco/core/src/IR/Conv2D.test.cpp index 4545939..ae2eba2 100644 --- a/contrib/coco/core/src/IR/Conv2D.test.cpp +++ b/contrib/coco/core/src/IR/Conv2D.test.cpp @@ -4,8 +4,12 @@ #include #include +#include + #include +using nncc::foundation::make_unique; + namespace { class Conv2DTest : public ::testing::Test @@ -130,3 +134,19 @@ TEST_F(Conv2DTest, dispose) ASSERT_EQ(op->ker(), nullptr); ASSERT_EQ(obj->uses()->size(), 0); } + +TEST_F(Conv2DTest, destructor) +{ + // Prepare a kernel object for testing + auto obj = obj_mgr.create(nncc::core::ADT::kernel::Shape{1, 1, 3, 3}); + + // Create 'Conv2D' op + auto op = make_unique(); + + op->ker(obj); + + // Destroy 'Conv2D' op + op.reset(); + + ASSERT_EQ(obj->uses()->size(), 0); +} -- 2.7.4