From 4b58cec6e6f8ad941acac448a10f77a4bb5e138d Mon Sep 17 00:00:00 2001 From: zhuyinlin <1085905529@qq.com> Date: Thu, 15 May 2025 10:55:15 +0800 Subject: [PATCH] =?UTF-8?q?ut=E7=94=A8=E4=BE=8B=E9=85=8D=E5=90=88=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9E=B6=E6=9E=84=E6=95=B4=E6=94=B9=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuyinlin <1085905529@qq.com> --- .../v1_0/hdi_device/hdi_device_test.cpp | 19 ---------- .../v2_0/hdi_device/hdi_device_test.cpp | 38 ------------------- 2 files changed, 57 deletions(-) diff --git a/test/unittest/components/v1_0/hdi_device/hdi_device_test.cpp b/test/unittest/components/v1_0/hdi_device/hdi_device_test.cpp index d3ce6af..0beb910 100644 --- a/test/unittest/components/v1_0/hdi_device/hdi_device_test.cpp +++ b/test/unittest/components/v1_0/hdi_device/hdi_device_test.cpp @@ -903,25 +903,6 @@ HWTEST_F(HDIDeviceTest, hdidevice_preparemodelfrommodelcache_002, TestSize.Level EXPECT_EQ(OH_NN_UNAVAILABLE_DEVICE, result); } -/* * - * @tc.name: hdidevice_preparemodelfrommodelcache_003 - * @tc.desc: Verify the PrepareModelFromModelCache function return nullptr. - * @tc.type: FUNC - */ -HWTEST_F(HDIDeviceTest, hdidevice_preparemodelfrommodelcache_003, TestSize.Level0) -{ - OHOS::sptr device = V1_0::INnrtDevice::Get(false); - std::unique_ptr hdiDevice = std::make_unique(device); - EXPECT_NE(hdiDevice, nullptr); - - std::vector modelCache = { { nullptr, 0 } }; - ModelConfig config; - std::shared_ptr preparedModel; - bool isUpdatable = false; - OH_NN_ReturnCode result = hdiDevice->PrepareModelFromModelCache(modelCache, config, preparedModel, isUpdatable); - EXPECT_EQ(OH_NN_NULL_PTR, result); -} - /* * * @tc.name: hdidevice_preparemodelfrommodelcache_004 * @tc.desc: Verify the PrepareModelFromModelCache function return success. diff --git a/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp b/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp index b36c802..f7646d2 100644 --- a/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp +++ b/test/unittest/components/v2_0/hdi_device/hdi_device_test.cpp @@ -1046,25 +1046,6 @@ HWTEST_F(HDIDeviceTest, hdidevice_preparemodelfrommodelcache_002, TestSize.Level EXPECT_EQ(OH_NN_FAILED, result); } -/* * - * @tc.name: hdidevice_preparemodelfrommodelcache_003 - * @tc.desc: Verify the PrepareModelFromModelCache function return nullptr. - * @tc.type: FUNC - */ -HWTEST_F(HDIDeviceTest, hdidevice_preparemodelfrommodelcache_003, TestSize.Level0) -{ - OHOS::sptr device = V2_0::INnrtDevice::Get(false); - std::unique_ptr hdiDevice = std::make_unique(device); - EXPECT_NE(hdiDevice, nullptr); - - std::vector modelCache = { { nullptr, 0 } }; - ModelConfig config; - std::shared_ptr preparedModel; - bool isUpdatable = false; - OH_NN_ReturnCode result = hdiDevice->PrepareModelFromModelCache(modelCache, config, preparedModel, isUpdatable); - EXPECT_EQ(OH_NN_NULL_PTR, result); -} - /* * * @tc.name: hdidevice_preparemodelfrommodelcache_004 * @tc.desc: Verify the PrepareModelFromModelCache function return success. @@ -2418,25 +2399,6 @@ HWTEST_F(HDIDeviceTest, hdidevice_V2_1_preparemodelfrommodelcache_002, TestSize. EXPECT_EQ(OH_NN_FAILED, result); } -/* * - * @tc.name: hdidevice_V2_1_preparemodelfrommodelcache_003 - * @tc.desc: Verify the PrepareModelFromModelCache function return nullptr. - * @tc.type: FUNC - */ -HWTEST_F(HDIDeviceTest, hdidevice_V2_1_preparemodelfrommodelcache_003, TestSize.Level0) -{ - sptr device = sptr(new (std::nothrow) MockIDevice()); - std::unique_ptr hdiDevice = std::make_unique(device); - EXPECT_NE(hdiDevice, nullptr); - - std::vector modelCache = { { nullptr, 0 } }; - ModelConfig config; - std::shared_ptr preparedModel; - bool isUpdatable = false; - OH_NN_ReturnCode result = hdiDevice->PrepareModelFromModelCache(modelCache, config, preparedModel, isUpdatable); - EXPECT_EQ(OH_NN_NULL_PTR, result); -} - /* * * @tc.name: hdidevice_V2_1_preparemodelfrommodelcache_004 * @tc.desc: Verify the PrepareModelFromModelCache function return success. -- Gitee