From 186afcde575cf311771f899289eab1d0181e8f85 Mon Sep 17 00:00:00 2001 From: l30054665 Date: Tue, 26 Nov 2024 15:36:41 +0800 Subject: [PATCH 1/5] mtp Signed-off-by: l30054665 --- services/storage_daemon/BUILD.gn | 2 +- services/storage_daemon/mtp/test/BUILD.gn | 2 + .../mtp/test/mtp_device_monitor_test.cpp | 128 ++++++++++++++++++ 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp diff --git a/services/storage_daemon/BUILD.gn b/services/storage_daemon/BUILD.gn index bdf58895..bccc55d2 100644 --- a/services/storage_daemon/BUILD.gn +++ b/services/storage_daemon/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. +# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/services/storage_daemon/mtp/test/BUILD.gn b/services/storage_daemon/mtp/test/BUILD.gn index 1b7ae460..76d4f480 100644 --- a/services/storage_daemon/mtp/test/BUILD.gn +++ b/services/storage_daemon/mtp/test/BUILD.gn @@ -65,6 +65,8 @@ ohos_unittest("mtp_device_manager_test") { ] } + + group("storage_daemon_mtp_test") { testonly = true deps = [ ":mtp_device_manager_test" ] diff --git a/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp b/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp new file mode 100644 index 00000000..f0a38132 --- /dev/null +++ b/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "gtest/gtest.h" +#include "mtp/mtp_device_manager.h" +#include "storage_service_errno.h" +#include "storage_service_log.h" +#include "utils/file_utils.h" +#include "utils/disk_utils.h" + +namespace OHOS { +namespace StorageDaemon { +using namespace testing::ext; +class MtpDeviceManagerTest : public testing::Test { +protected: + MtpDeviceInfo deviceInfo; + +public: + static void SetUpTestCase(void){}; + static void TearDownTestCase(void){}; + void SetUp() + { + deviceInfo.path = "/test/path"; + deviceInfo.id = 1; + deviceInfo.vendor = "TestVendor"; + deviceInfo.uuid = "TestUUID"; + } + + void TearDown() {} +}; + +/** + * @tc.name : MountDeviceTest_001 + * @tc.number: MountDeviceTest_001 + * @tc.desc : Test when device is mounting + */ +HWTEST_F(MtpDeviceManagerTest, MountDeviceTest_001, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountDeviceTest_001 start"; + + auto manager = DelayedSingleton::GetInstance(); + manager->isMounting = true; + int32_t result = manager->MountDevice(deviceInfo); + EXPECT_EQ(result, E_MTP_IS_MOUNTING); + + GTEST_LOG_(INFO) << "MountDeviceTest_001 end"; +} + +/** + * @tc.name : MountDeviceTest_002 + * @tc.number: MountDeviceTest_002 + * @tc.desc : Test when device is not mounting + */ +HWTEST_F(MtpDeviceManagerTest, MountDeviceTest_002, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountDeviceTest_002 start"; + + auto manager = DelayedSingleton::GetInstance(); + manager->isMounting = false; + int32_t result = manager->MountDevice(deviceInfo); + EXPECT_EQ(result, E_MTP_PREPARE_DIR_ERR); + + GTEST_LOG_(INFO) << "MountDeviceTest_002 end"; +} + +/** + * @tc.name : MountDeviceTest_003 + * @tc.number: MountDeviceTest_003 + * @tc.desc : Test when device is not mounting + */ +HWTEST_F(MtpDeviceManagerTest, MountDeviceTest_003, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountDeviceTest_003 start"; + + auto manager = DelayedSingleton::GetInstance(); + manager->isMounting = false; + deviceInfo.path = "/mnt/data/external"; + int32_t result = manager->MountDevice(deviceInfo); + EXPECT_EQ(result, E_OK); + + GTEST_LOG_(INFO) << "MountDeviceTest_003 end"; +} + +/** + * @tc.name : UmountDeviceTest_001 + * @tc.number: UmountDeviceTest_001 + * @tc.desc : Test when umount and remove both succeed + */ +HWTEST_F(MtpDeviceManagerTest, UmountDeviceTest_001, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "UmountDeviceTest_001 start"; + + auto manager = DelayedSingleton::GetInstance(); + deviceInfo.path = "/test/path"; + EXPECT_EQ(manager->UmountDevice(deviceInfo, false), E_MTP_UMOUNT_FAILED); + + GTEST_LOG_(INFO) << "UmountDeviceTest_001 end"; +} + +/** + * @tc.name : UmountDeviceTest_002 + * @tc.number: UmountDeviceTest_002 + * @tc.desc : Test when umount and remove both succeed + */ +HWTEST_F(MtpDeviceManagerTest, UmountDeviceTest_002, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "UmountDeviceTest_002 start"; + + auto manager = DelayedSingleton::GetInstance(); + deviceInfo.path = "/test/path"; + EXPECT_EQ(manager->UmountDevice(deviceInfo, true), E_MTP_UMOUNT_FAILED); + + GTEST_LOG_(INFO) << "UmountDeviceTest_002 end"; +} +} // STORAGE_DAEMON +} // OHOS -- Gitee From d9c295e23c8b4869a4c87e5e047f5a6f74b4b498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Tue, 26 Nov 2024 09:38:03 +0000 Subject: [PATCH 2/5] update services/storage_daemon/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- services/storage_daemon/BUILD.gn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/storage_daemon/BUILD.gn b/services/storage_daemon/BUILD.gn index bccc55d2..38944953 100644 --- a/services/storage_daemon/BUILD.gn +++ b/services/storage_daemon/BUILD.gn @@ -383,12 +383,14 @@ group("storage_daemon_unit_test") { if (storage_service_external_storage_manager) { deps += [ "disk/test:storage_daemon_disk_test", - "mtp/test:storage_daemon_mtp_test", "netlink/test:storage_daemon_netlink_test", "volume/test:storage_daemon_volume_test", ] } if (support_open_source_libmtp) { - deps += [ "mtpfs/test:storage_daemon_mtpfs_test" ] + deps += [ + "mtp/test:storage_daemon_mtp_test", + "mtpfs/test:storage_daemon_mtpfs_test", + ] } } -- Gitee From 81d19d6115d3d6c29621c72176797037a7edf1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Tue, 26 Nov 2024 09:38:50 +0000 Subject: [PATCH 3/5] update services/storage_daemon/mtp/test/BUILD.gn. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- services/storage_daemon/mtp/test/BUILD.gn | 60 +++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/services/storage_daemon/mtp/test/BUILD.gn b/services/storage_daemon/mtp/test/BUILD.gn index 76d4f480..7d2cad40 100644 --- a/services/storage_daemon/mtp/test/BUILD.gn +++ b/services/storage_daemon/mtp/test/BUILD.gn @@ -55,19 +55,73 @@ ohos_unittest("mtp_device_manager_test") { "$ROOT_DIR/storage_daemon/utils/file_utils.cpp", ] - deps = [ "//third_party/googletest:gtest_main" ] - external_deps = [ "c_utils:utils", + "googletest:gtest_main", "hilog:libhilog", "ipc:ipc_single", "samgr:samgr_proxy", ] } +ohos_unittest("mtp_device_monitor_test") { + branch_protector_ret = "pac_ret" + sanitize = { + integer_overflow = true + cfi = true + cfi_cross_dso = true + debug = false + } + module_out_path = "storage_service/storage_daemon" + + defines = [ + "STORAGE_LOG_TAG = \"StorageDaemon\"", + "private = public", + ] + cflags = [ + "-w", + "-DFUSE_USE_VERSION=31", + "-D_FILE_OFFSET_BITS=64", + "-std=c++11", + ] + + include_dirs = [ + "${storage_daemon_path}/mtpfs/include", + "${storage_service_common_path}/include", + "${storage_daemon_path}/include", + "${storage_service_path}/utils/include", + "${storage_service_path}/storage_manager/include", + "${storage_interface_path}/innerkits/storage_manager/native", + ] + + sources = [ + "$ROOT_DIR/storage_daemon/ipc/src/storage_manager_client.cpp", + "$ROOT_DIR/storage_daemon/mtp/src/mtp_device_manager.cpp", + "$ROOT_DIR/storage_daemon/mtp/src/mtp_device_monitor.cpp", + "$ROOT_DIR/storage_daemon/mtp/test/mtp_device_monitor_test.cpp", + "$ROOT_DIR/storage_daemon/utils/disk_utils.cpp", + "$ROOT_DIR/storage_daemon/utils/file_utils.cpp", + ] + + external_deps = [ + "c_utils:utils", + "googletest:gtest_main", + "hilog:libhilog", + "init:libbegetutil", + "ipc:ipc_single", + "samgr:samgr_proxy", + ] + + if (support_open_source_libmtp) { + external_deps += [ "libmtp:libmtp" ] + } +} group("storage_daemon_mtp_test") { testonly = true - deps = [ ":mtp_device_manager_test" ] + deps = [ + ":mtp_device_manager_test", + ":mtp_device_monitor_test", + ] } -- Gitee From ae8f2dab5222f5f7a18398e832cf2b79c305ae1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Tue, 26 Nov 2024 09:40:19 +0000 Subject: [PATCH 4/5] update services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../mtp/test/mtp_device_monitor_test.cpp | 261 +++++++++++++----- 1 file changed, 199 insertions(+), 62 deletions(-) diff --git a/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp b/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp index f0a38132..74128456 100644 --- a/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp +++ b/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp @@ -15,6 +15,7 @@ #include "gtest/gtest.h" #include "mtp/mtp_device_manager.h" +#include "mtp/mtp_device_monitor.h" #include "storage_service_errno.h" #include "storage_service_log.h" #include "utils/file_utils.h" @@ -23,106 +24,242 @@ namespace OHOS { namespace StorageDaemon { using namespace testing::ext; -class MtpDeviceManagerTest : public testing::Test { -protected: - MtpDeviceInfo deviceInfo; +class MtpDeviceMonitorTest : public testing::Test { public: - static void SetUpTestCase(void){}; - static void TearDownTestCase(void){}; - void SetUp() - { - deviceInfo.path = "/test/path"; - deviceInfo.id = 1; - deviceInfo.vendor = "TestVendor"; - deviceInfo.uuid = "TestUUID"; - } - - void TearDown() {} + static void SetUpTestCase(void) {}; + static void TearDownTestCase(void) {}; + + void SetUp(){}; + void TearDown(){}; }; /** - * @tc.name : MountDeviceTest_001 - * @tc.number: MountDeviceTest_001 - * @tc.desc : Test when device is mounting + * @tc.name: HasMounted_001 + * @tc.desc: Verify the Decode function of Devpath and Syspath. + * @tc.type: FUNC */ -HWTEST_F(MtpDeviceManagerTest, MountDeviceTest_001, TestSize.Level1) +HWTEST_F(MtpDeviceMonitorTest, HasMounted_001, TestSize.Level1) { - GTEST_LOG_(INFO) << "MountDeviceTest_001 start"; + GTEST_LOG_(INFO) << "HasMounted_001 start"; - auto manager = DelayedSingleton::GetInstance(); - manager->isMounting = true; - int32_t result = manager->MountDevice(deviceInfo); - EXPECT_EQ(result, E_MTP_IS_MOUNTING); + auto monitor = DelayedSingleton::GetInstance(); + MtpDeviceInfo device; + device.id = 1; + int32_t result = monitor->HasMounted(device); + EXPECT_FALSE(result); - GTEST_LOG_(INFO) << "MountDeviceTest_001 end"; + GTEST_LOG_(INFO) << "HasMounted_001 end"; } /** - * @tc.name : MountDeviceTest_002 - * @tc.number: MountDeviceTest_002 - * @tc.desc : Test when device is not mounting + * @tc.name: HasMounted_002 + * @tc.desc: Verify the Decode function of Devpath and Syspath. + * @tc.type: FUNC */ -HWTEST_F(MtpDeviceManagerTest, MountDeviceTest_002, TestSize.Level1) +HWTEST_F(MtpDeviceMonitorTest, HasMounted_002, TestSize.Level1) { - GTEST_LOG_(INFO) << "MountDeviceTest_002 start"; + GTEST_LOG_(INFO) << "HasMounted_002 start"; + + auto monitor = DelayedSingleton::GetInstance(); + MtpDeviceInfo device; + device.id = "1"; + monitor->lastestMtpDevList_.push_back(device); + int32_t result = monitor->HasMounted(device); + EXPECT_TRUE(result); + monitor->lastestMtpDevList_.clear(); + + GTEST_LOG_(INFO) << "HasMounted_002 end"; +} - auto manager = DelayedSingleton::GetInstance(); - manager->isMounting = false; - int32_t result = manager->MountDevice(deviceInfo); +/** + * @tc.name: MountTest_001 + * @tc.desc: Test when the device does not exist, Mount method should return E_NON_EXIST. + * @tc.type: FUNC + */ +HWTEST_F(MtpDeviceMonitorTest, MountTest_001, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountTest_001 start"; + + auto monitor = DelayedSingleton::GetInstance(); + std::string id = "test_id"; + MtpDeviceInfo device; + device.id = id; + monitor->lastestMtpDevList_.push_back(device); + int32_t result = monitor->Mount(id); EXPECT_EQ(result, E_MTP_PREPARE_DIR_ERR); + monitor->lastestMtpDevList_.clear(); + + GTEST_LOG_(INFO) << "MountTest_001 end"; +} + +/** + * @tc.name: MountTest_002 + * @tc.desc: Test when MountDevice fails, Mount method should return an error code. + * @tc.type: FUNC + */ +HWTEST_F(MtpDeviceMonitorTest, MountTest_002, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountTest_002 start"; + + auto monitor = DelayedSingleton::GetInstance(); + std::string id = "test_id"; + MtpDeviceInfo device; + device.id = id; + int32_t result = monitor->Mount(id); + EXPECT_EQ(result, E_NON_EXIST); + + GTEST_LOG_(INFO) << "MountTest_002 end"; +} + +/** + * @tc.name: UmountTest_001 + * @tc.desc: Test Umount method returns error when UmountDevice fails. + * @tc.type: FUNC + */ +HWTEST_F(MtpDeviceMonitorTest, UmountTest_001, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "UmountTest_001 start"; + + auto monitor = DelayedSingleton::GetInstance(); + std::string id = "test_id"; + MtpDeviceInfo device; + device.id = id; + monitor->lastestMtpDevList_.push_back(device); + int32_t result = monitor->Umount(id); + EXPECT_EQ(result, E_MTP_UMOUNT_FAILED); + monitor->lastestMtpDevList_.clear(); + + GTEST_LOG_(INFO) << "UmountTest_001 end"; +} + +/** + * @tc.name: UmountTest_002 + * @tc.desc: Test Umount method returns error when UmountDevice fails. + * @tc.type: FUNC + */ +HWTEST_F(MtpDeviceMonitorTest, UmountTest_002, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "UmountTest_002 start"; + + auto monitor = DelayedSingleton::GetInstance(); + std::string id = "test_id"; + MtpDeviceInfo device; + device.id = id; + int32_t result = monitor->Umount(id); + EXPECT_EQ(result, E_NON_EXIST); + + GTEST_LOG_(INFO) << "UmountTest_002 end"; +} + +/** + * @tc.name: MountMtpDeviceTest_001 + * @tc.desc: Test when device is already mounted, MountMtpDevice should not mount it again. + * @tc.type: FUNC + */ +HWTEST_F(MtpDeviceMonitorTest, MountMtpDeviceTest_001, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountMtpDeviceTest_001 start"; + + auto monitor = DelayedSingleton::GetInstance(); + std::vector devices; + MtpDeviceInfo device; + device.id = "123"; + devices.push_back(device); + monitor->lastestMtpDevList_.push_back(device); + monitor->MountMtpDevice(devices); + std::vector lastestMtpDevList = monitor->lastestMtpDevList_; + EXPECT_EQ(lastestMtpDevList.size(), 1); + monitor->lastestMtpDevList_.clear(); + + GTEST_LOG_(INFO) << "MountMtpDeviceTest_001 end"; +} + +/** + * @tc.name: MountMtpDeviceTest_002 + * @tc.desc: Test when device is ejected, MountMtpDevice should not mount it. + * @tc.type: FUNC + */ +HWTEST_F(MtpDeviceMonitorTest, MountMtpDeviceTest_002, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "MountMtpDeviceTest_002 start"; + + auto monitor = DelayedSingleton::GetInstance(); + std::vector devices; + MtpDeviceInfo device; + device.id = "123"; + devices.push_back(device); + monitor->hasEjectedDevices_.push_back(device); + monitor->MountMtpDevice(devices); + std::vector lastestMtpDevList = monitor->lastestMtpDevList_; + EXPECT_EQ(lastestMtpDevList.size(), 0); + monitor->hasEjectedDevices_.clear(); - GTEST_LOG_(INFO) << "MountDeviceTest_002 end"; + GTEST_LOG_(INFO) << "MountMtpDeviceTest_002 end"; } /** - * @tc.name : MountDeviceTest_003 - * @tc.number: MountDeviceTest_003 - * @tc.desc : Test when device is not mounting + * @tc.name: MountMtpDeviceTest_003 + * @tc.desc: Test when device is invalid, MountMtpDevice should not mount it. + * @tc.type: FUNC */ -HWTEST_F(MtpDeviceManagerTest, MountDeviceTest_003, TestSize.Level1) +HWTEST_F(MtpDeviceMonitorTest, MountMtpDeviceTest_003, TestSize.Level1) { - GTEST_LOG_(INFO) << "MountDeviceTest_003 start"; + GTEST_LOG_(INFO) << "MountMtpDeviceTest_003 start"; - auto manager = DelayedSingleton::GetInstance(); - manager->isMounting = false; - deviceInfo.path = "/mnt/data/external"; - int32_t result = manager->MountDevice(deviceInfo); - EXPECT_EQ(result, E_OK); + auto monitor = DelayedSingleton::GetInstance(); + std::vector devices; + MtpDeviceInfo device; + device.id = "123"; + devices.push_back(device); + monitor->invalidMtpDevices_.push_back(device); + monitor->MountMtpDevice(devices); + std::vector lastestMtpDevList = monitor->lastestMtpDevList_; + EXPECT_EQ(lastestMtpDevList.size(), 0); + monitor->invalidMtpDevices_.clear(); - GTEST_LOG_(INFO) << "MountDeviceTest_003 end"; + GTEST_LOG_(INFO) << "MountMtpDeviceTest_003 end"; } /** - * @tc.name : UmountDeviceTest_001 - * @tc.number: UmountDeviceTest_001 - * @tc.desc : Test when umount and remove both succeed + * @tc.name: MountMtpDeviceTest_004 + * @tc.desc: Test when device is valid, MountMtpDevice should mount it. + * @tc.type: FUNC */ -HWTEST_F(MtpDeviceManagerTest, UmountDeviceTest_001, TestSize.Level1) +HWTEST_F(MtpDeviceMonitorTest, MountMtpDeviceTest_004, TestSize.Level1) { - GTEST_LOG_(INFO) << "UmountDeviceTest_001 start"; + GTEST_LOG_(INFO) << "MountMtpDeviceTest_004 start"; - auto manager = DelayedSingleton::GetInstance(); - deviceInfo.path = "/test/path"; - EXPECT_EQ(manager->UmountDevice(deviceInfo, false), E_MTP_UMOUNT_FAILED); + auto monitor = DelayedSingleton::GetInstance(); + std::vector devices; + MtpDeviceInfo device1; + device1.id = "123"; + MtpDeviceInfo device2; + device2.id = "456"; + devices.push_back(device1); + devices.push_back(device2); + monitor->lastestMtpDevList_.push_back(device1); + monitor->MountMtpDevice(devices); + std::vector lastestMtpDevList = monitor->lastestMtpDevList_; + EXPECT_EQ(lastestMtpDevList.size(), 1); - GTEST_LOG_(INFO) << "UmountDeviceTest_001 end"; + GTEST_LOG_(INFO) << "MountMtpDeviceTest_004 end"; } /** - * @tc.name : UmountDeviceTest_002 - * @tc.number: UmountDeviceTest_002 - * @tc.desc : Test when umount and remove both succeed + * @tc.name: IsNeedDisableMtp_001 + * @tc.desc: Test when mtpEnable is "false", IsNeedDisableMtp should return false + * @tc.type: FUNC */ -HWTEST_F(MtpDeviceManagerTest, UmountDeviceTest_002, TestSize.Level1) +HWTEST_F(MtpDeviceMonitorTest, IsNeedDisableMtp_001, TestSize.Level1) { - GTEST_LOG_(INFO) << "UmountDeviceTest_002 start"; + GTEST_LOG_(INFO) << "IsNeedDisableMtp_001 start"; - auto manager = DelayedSingleton::GetInstance(); - deviceInfo.path = "/test/path"; - EXPECT_EQ(manager->UmountDevice(deviceInfo, true), E_MTP_UMOUNT_FAILED); + auto monitor = DelayedSingleton::GetInstance(); + bool result = monitor->IsNeedDisableMtp(); + EXPECT_FALSE(result); - GTEST_LOG_(INFO) << "UmountDeviceTest_002 end"; + GTEST_LOG_(INFO) << "IsNeedDisableMtp_001 end"; } } // STORAGE_DAEMON } // OHOS -- Gitee From adaa8b7c23d69cb93b5a8bfe23a4e3b4de0f4a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Tue, 26 Nov 2024 12:18:39 +0000 Subject: [PATCH 5/5] update services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp b/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp index 74128456..4e7053e4 100644 --- a/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp +++ b/services/storage_daemon/mtp/test/mtp_device_monitor_test.cpp @@ -24,12 +24,11 @@ namespace OHOS { namespace StorageDaemon { using namespace testing::ext; -class MtpDeviceMonitorTest : public testing::Test { +class MtpDeviceMonitorTest : public testing::Test { public: static void SetUpTestCase(void) {}; static void TearDownTestCase(void) {}; - void SetUp(){}; void TearDown(){}; }; -- Gitee