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 d3ce6af40f5f4fbbe05a7c747b2dac83123d17fe..0beb9100e0e02c775f862e094c864a6767a67932 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 b36c8028fe1e0489e229a95150333181de2d753b..f7646d21db713ec07ace925d2b76d1415dc0a843 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.