{
auto o = obj_mgr.create(nncc::core::ADT::feature::Shape{1, 1, 1});
- // TODO Rename 'def'
- ::mock::Producer def;
+ ::mock::Producer producer;
+ coco::Def def{&producer};
- // TODO Rename 'slot'
- coco::Def slot{&def};
-
- ASSERT_EQ(slot.value(), nullptr);
+ ASSERT_EQ(def.value(), nullptr);
}
TEST_F(DefTest, value)
{
auto o = obj_mgr.create(nncc::core::ADT::feature::Shape{1, 1, 1});
- // TODO Rename 'def'
- ::mock::Producer def;
-
- // TODO Rename 'slot'
- coco::Def slot{&def};
+ ::mock::Producer producer;
+ coco::Def def{&producer};
- slot.value(o);
+ def.value(o);
- ASSERT_EQ(slot.value(), o);
+ ASSERT_EQ(def.value(), o);
- ASSERT_EQ(o->def(), &slot);
+ ASSERT_EQ(o->def(), &def);
- slot.value(nullptr);
+ def.value(nullptr);
ASSERT_EQ(o->def(), nullptr);
}
{
auto o = obj_mgr.create(nncc::core::ADT::feature::Shape{1, 1, 1});
- // TODO Rename 'def'
- ::mock::Producer def;
-
- // TODO Rename 'slot'
- auto slot = make_unique<coco::Def>(&def);
+ ::mock::Producer producer;
+ auto def = make_unique<coco::Def>(&producer);
- slot->value(o);
- ASSERT_EQ(o->def(), slot.get());
+ def->value(o);
+ ASSERT_EQ(o->def(), def.get());
// Let's destruct the allocated slot
- slot.reset(nullptr);
+ def.reset(nullptr);
// The def of Object SHOULD BE updated
ASSERT_EQ(o->def(), nullptr);