diff --git a/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp b/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp index ab00317fef0a4dc89aaa3b01a2d0e116e2280645..94b27e22ae932277cb3aeb65e684bef4defe1295 100644 --- a/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp +++ b/test/unittest/components/v1_0/neural_network_runtime_test/neural_network_runtime_test.cpp @@ -688,20 +688,6 @@ HWTEST_F(NeuralNetworkRuntimeTest, model_destroy_001, testing::ext::TestSize.Lev EXPECT_EQ(nullptr, pModel); } -/* - * @tc.name: model_destroy_002 - * @tc.desc: Verify the *OH_NNModel is nullptr of the OH_NNModel_Destroy function. - * @tc.type: FUNC - */ -HWTEST_F(NeuralNetworkRuntimeTest, model_destroy_002, testing::ext::TestSize.Level0) -{ - InnerModel innerModel; - OH_NNModel* model = nullptr; - OH_NNModel** pModel = &model; - OH_NNModel_Destroy(pModel); - EXPECT_EQ(nullptr, model); -} - /* * @tc.name: model_destroy_003 * @tc.desc: Verify the normal model of the OH_NNModel_Destroy function. @@ -1094,19 +1080,6 @@ HWTEST_F(NeuralNetworkRuntimeTest, compilation_destroy_001, testing::ext::TestSi EXPECT_EQ(nullptr, pCompilation); } -/* - * @tc.name: compilation_destroy_002 - * @tc.desc: Verify the *OH_NNCompilation is nullptr of the OH_NNCompilation_Destroy function. - * @tc.type: FUNC - */ -HWTEST_F(NeuralNetworkRuntimeTest, compilation_destroy_002, testing::ext::TestSize.Level0) -{ - OH_NNCompilation* compilation = nullptr; - OH_NNCompilation** pCompilation = &compilation; - OH_NNCompilation_Destroy(pCompilation); - EXPECT_EQ(nullptr, compilation); -} - /* * @tc.name: compilation_destroy_003 * @tc.desc: Verify the normal model of the OH_NNCompilation_Destroy function. @@ -2142,13 +2115,13 @@ HWTEST_F(NeuralNetworkRuntimeTest, executor_destroy_input_memory_003, testing::e std::vector, OH_NN_TensorType>> m_outputTensorDescs; NNExecutor* executor = new (std::nothrow) NNExecutor( m_backendID, m_device, mockIPreparedMode, m_inputTensorDescs, m_outputTensorDescs); + EXPECT_NE(executor, nullptr); OH_NNExecutor* nnExecutor = reinterpret_cast(executor); uint32_t inputIndex = 0; OH_NN_Memory* memory = nullptr; OH_NN_Memory** pMemory = &memory; OH_NNExecutor_DestroyInputMemory(nnExecutor, inputIndex, pMemory); - EXPECT_EQ(nullptr, memory); testing::Mock::AllowLeak(mockIPreparedMode.get()); } @@ -2244,13 +2217,13 @@ HWTEST_F(NeuralNetworkRuntimeTest, executor_destroy_output_memory_003, testing:: std::vector, OH_NN_TensorType>> m_outputTensorDescs; NNExecutor* executor = new (std::nothrow) NNExecutor( m_backendID, m_device, mockIPreparedMode, m_inputTensorDescs, m_outputTensorDescs); + EXPECT_NE(executor, nullptr); OH_NNExecutor* nnExecutor = reinterpret_cast(executor); uint32_t outputIndex = 0; OH_NN_Memory* memory = nullptr; OH_NN_Memory** pMemory = &memory; OH_NNExecutor_DestroyOutputMemory(nnExecutor, outputIndex, pMemory); - EXPECT_EQ(nullptr, memory); testing::Mock::AllowLeak(mockIPreparedMode.get()); } @@ -2514,19 +2487,6 @@ HWTEST_F(NeuralNetworkRuntimeTest, executor_destroy_001, testing::ext::TestSize. EXPECT_EQ(nullptr, pExecutor); } -/* - * @tc.name: executor_destroy_002 - * @tc.desc: Verify the *OH_NNExecutor is nullptr of the OH_NNExecutor_Destroy function. - * @tc.type: FUNC - */ -HWTEST_F(NeuralNetworkRuntimeTest, executor_destroy_002, testing::ext::TestSize.Level0) -{ - OH_NNExecutor* nnExecutor = nullptr; - OH_NNExecutor** pExecutor = &nnExecutor; - OH_NNExecutor_Destroy(pExecutor); - EXPECT_EQ(nullptr, nnExecutor); -} - /* * @tc.name: device_get_all_devices_id_001 * @tc.desc: Verify the allDevicesID is nullptr of the OH_NNDevice_GetAllDevicesID function. diff --git a/test/unittest/ops/eltwise_test.cpp b/test/unittest/ops/eltwise_test.cpp index 8f15c1292b02c422e80c63b9d3d33e1df7751d30..8749f4dcd26b4e3e48c2232415cb3ffb6b328382 100644 --- a/test/unittest/ops/eltwise_test.cpp +++ b/test/unittest/ops/eltwise_test.cpp @@ -273,7 +273,7 @@ HWTEST_F(EltwiseBuilderTest, eltwise_getprimitive_001, TestSize.Level1) LiteGraphTensorPtr expectPrimitive = {nullptr, DestroyLiteGraphPrimitive}; EXPECT_NE(expectPrimitive, primitive); bool eltwiseModeReturn = mindspore::lite::MindIR_Eltwise_GetMode(primitive.get()); - EXPECT_EQ(eltwiseModeReturn, eltwiseModeReturn); + EXPECT_EQ(false, eltwiseModeReturn); } /**