From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Wed, 5 Sep 2018 08:15:00 +0000 (+0900) Subject: [coco] Remove unused onUpdate hook (#1347) X-Git-Tag: nncc_backup~1935 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76f719521fb41f5c6e2c52098957a74889b731e0;p=platform%2Fcore%2Fml%2Fnnfw.git [coco] Remove unused onUpdate hook (#1347) * [coco] Remove unused onUpdate hook This commit removes unused onUpdate hook from Object. Signed-off-by: Jonghyun Park * Update related comment --- diff --git a/contrib/coco/core/include/coco/IR/Object.h b/contrib/coco/core/include/coco/IR/Object.h index 1ee0b72..2d36d9a 100644 --- a/contrib/coco/core/include/coco/IR/Object.h +++ b/contrib/coco/core/include/coco/IR/Object.h @@ -42,9 +42,6 @@ protected: virtual void get(ObjectInfo **) const = 0; virtual void get(const PtrLink **) const = 0; -protected: - virtual void onUpdate(Bag *) { return; } - private: coco::Bag *_bag; diff --git a/contrib/coco/core/src/IR/Object.cpp b/contrib/coco/core/src/IR/Object.cpp index 0582ba0..eba9529 100644 --- a/contrib/coco/core/src/IR/Object.cpp +++ b/contrib/coco/core/src/IR/Object.cpp @@ -32,8 +32,6 @@ void Object::bag(coco::Bag *bag) { // TODO Update bag-object relation _bag = bag; - // Notify descendant - onUpdate(bag); auto bag_info = info(_bag); assert(bag_info != nullptr); diff --git a/contrib/coco/core/src/IR/Object.test.cpp b/contrib/coco/core/src/IR/Object.test.cpp index 73aefbb..99ba140 100644 --- a/contrib/coco/core/src/IR/Object.test.cpp +++ b/contrib/coco/core/src/IR/Object.test.cpp @@ -43,24 +43,6 @@ private: } // namespace mock } // namespace -namespace -{ -struct DummyObject : public ::mock::Object -{ -public: - DummyObject(std::vector &updates) : _updates(updates) - { - // DO NOTHING - } - -private: - void onUpdate(coco::Bag *bag) override { _updates.emplace_back(bag); } - -private: - std::vector &_updates; -}; -} // namespace - TEST_F(ObjectTest, ctor) { ::mock::Object obj; @@ -80,9 +62,8 @@ TEST_F(ObjectTest, bag_update) // Prepare bag auto bag = bag_mgr.create(1); - // Test 'Object' class through 'DummyObject' - std::vector updates; - DummyObject obj{updates}; + // Test 'Object' class through a mock-up object + ::mock::Object obj; obj.info = make_unique(); obj.link = &link; @@ -92,8 +73,6 @@ TEST_F(ObjectTest, bag_update) // 'bag(Bag *)' should affect the return of 'bag(void)' ASSERT_EQ(obj.bag(), bag); - ASSERT_EQ(updates.size(), 1); - // The dependent object list of each bag should be updated on 'bag(...)' call. auto bag_info = link.find(bag);