From f2022b92cce348f7dc10d05363571438ff85f337 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Tue, 6 Jul 2021 10:09:54 +0800 Subject: [PATCH] Fix ut. --- tests/ut/ge/single_op/single_op_task_unittest.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/ut/ge/single_op/single_op_task_unittest.cc b/tests/ut/ge/single_op/single_op_task_unittest.cc index 51ef928f..f6ae0dbf 100644 --- a/tests/ut/ge/single_op/single_op_task_unittest.cc +++ b/tests/ut/ge/single_op/single_op_task_unittest.cc @@ -158,16 +158,21 @@ TEST_F(UtestSingleOpTask, test_atomic_exec) { auto graph = make_shared("graph"); auto op_desc = make_shared("Add", "Add"); auto node = graph->AddNode(op_desc); - AtomicOpTask task; task.op_desc_ = op_desc; task.node_ = node; vector inputs; vector outputs; - task.atomic_output_indices_ = { 0 }; + std::vector atomic_output_indices; + ge::AttrUtils::SetListInt(op_desc, ATOMIC_ATTR_OUTPUT_INDEX, atomic_output_indices); + ASSERT_EQ(task.InitAtomicAddrCleanIndices(), INTERNAL_ERROR); + atomic_output_indices = { 0 }; + ge::AttrUtils::SetListInt(op_desc, ATOMIC_ATTR_OUTPUT_INDEX, atomic_output_indices); + ASSERT_EQ(task.InitAtomicAddrCleanIndices(), INTERNAL_ERROR); task.arg_size_ = sizeof(void *) * 2; task.args_.reset(new (std::nothrow) uint8_t[task.arg_size_]); + ASSERT_EQ(task.InitAtomicAddrCleanIndices(), SUCCESS); ASSERT_EQ(task.UpdateIoAddr(inputs, outputs), ACL_ERROR_GE_PARAM_INVALID); ge::DataBuffer data_buffer;