From 3d33e8aad28b6490b197686906223c098b47c0f4 Mon Sep 17 00:00:00 2001 From: w30052974 Date: Wed, 15 Jan 2025 18:05:57 +0800 Subject: [PATCH] =?UTF-8?q?ut=20=E6=96=AD=E8=A8=80=E4=BF=AE=E5=A4=8D2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: w30052974 --- .../neural_network_runtime_test.cpp | 44 +------------------ 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp b/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp index a318a4e..37a4517 100644 --- a/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp +++ b/test/unittest/components/v2_0/neural_network_runtime_test/neural_network_runtime_test.cpp @@ -635,20 +635,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. @@ -1041,19 +1027,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. @@ -1647,12 +1620,12 @@ HWTEST_F(NeuralNetworkRuntimeTest, executor_destroy_input_memory_003, testing::e OH_NNModel* model = reinterpret_cast(&innerModel); OH_NNCompilation* nnCompilation = OH_NNCompilation_Construct(model); OH_NNExecutor* nnExecutor = OH_NNExecutor_Construct(nnCompilation); + EXPECT_EQ(nnExecutor, nullptr); uint32_t inputIndex = 0; OH_NN_Memory* memory = nullptr; OH_NN_Memory** pMemory = &memory; OH_NNExecutor_DestroyInputMemory(nnExecutor, inputIndex, pMemory); - EXPECT_EQ(nullptr, memory); } /* @@ -1751,12 +1724,12 @@ HWTEST_F(NeuralNetworkRuntimeTest, executor_destroy_output_memory_003, testing:: OH_NNModel* model = reinterpret_cast(&innerModel); OH_NNCompilation* nnCompilation = OH_NNCompilation_Construct(model); OH_NNExecutor* nnExecutor = OH_NNExecutor_Construct(nnCompilation); + EXPECT_EQ(nnExecutor, nullptr); uint32_t outputIndex = 0; OH_NN_Memory* memory = nullptr; OH_NN_Memory** pMemory = &memory; OH_NNExecutor_DestroyOutputMemory(nnExecutor, outputIndex, pMemory); - EXPECT_EQ(nullptr, memory); } /* @@ -1969,19 +1942,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. -- Gitee