Skip to content

Commit

Permalink
Title:chore, add gvfs ut.
Browse files Browse the repository at this point in the history
Description: gvfs 相关单元测试

RootCause:Null

Solution:
Change-Id: Idb083c10cf0f5dfd20bcc7c3731172ecae5c7c78
Reviewed-on: http://gerrit.uniontech.com/c/chengdu/dde-file-manager/+/5643
Reviewed-by: <mailman@uniontech.com>
Reviewed-by: xushitong <xushitong@uniontech.com>
Reviewed-by: lvwujun <lvwujun@uniontech.com>
Tested-by: <mailman@uniontech.com>
  • Loading branch information
Johnson-zs committed Sep 21, 2020
1 parent 07e1637 commit 79473f1
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Expand Up @@ -47,3 +47,19 @@ NUL
doc/html/*

tools

dde-file-manager-lib/test_shutil/fileutils/fileutil_t1.txt

dde-file-manager-lib/test_shutil/fileutils/fileutil_t2.txt

dde-file-manager-lib/test_shutil/fileutils/jsonArry.json

dde-file-manager-lib/test_shutil/fileutils/jsonObj.json

dde-file-manager-lib/test_shutil/fileutils/sub/fileutil_file_new1.txt

dde-file-manager-lib/test_shutil/new1.txt

dde-file-manager-lib/test_shutil/new2.txt

dde-file-manager-lib/test_shutil/property/oneProperty.pro
4 changes: 2 additions & 2 deletions dde-file-manager-lib/tests/gvfs/ut_gvfsmountmanager.cpp
Expand Up @@ -65,10 +65,10 @@ TEST_F(TestGvfsMountManager, qMountToqDiskinfo)

TEST_F(TestGvfsMountManager, mount)
{
GvfsMountManager::mount("/dev/sdb");
GvfsMountManager::mount("/dev/sda1");
}

TEST_F(TestGvfsMountManager, eject)
{
GvfsMountManager::mount("/dev/sr0");
GvfsMountManager::mount("/dev/sda1");
}
58 changes: 58 additions & 0 deletions dde-file-manager-lib/tests/gvfs/ut_secretmanager.cpp
@@ -0,0 +1,58 @@
/*
* Copyright (C) 2019 ~ 2020 Deepin Technology Co., Ltd.
*
* Author: zhangsheng <zhangsheng@uniontech.com>
*
* Maintainer: zhangsheng <zhangsheng@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gvfs/secretmanager.h"

#include <gtest/gtest.h>

namespace {
class TestSecretManager: public testing::Test
{
public:
SecretManager *m_secreat {nullptr};
void SetUp() override
{
m_secreat = new SecretManager;
}

void TearDown() override
{
delete m_secreat;
}
};
}

TEST_F(TestSecretManager, SMBSecretSchema)
{
const SecretSchema *schema = m_secreat->SMBSecretSchema();
EXPECT_TRUE(schema);
}

TEST_F(TestSecretManager, FTPSecretSchema)
{
const SecretSchema *schema = m_secreat->FTPSecretSchema();
EXPECT_TRUE(schema);
}

TEST_F(TestSecretManager, VaultSecretSchema)
{
const SecretSchema *schema = m_secreat->VaultSecretSchema();
EXPECT_TRUE(schema);
}
7 changes: 6 additions & 1 deletion dde-file-manager-lib/tests/test.pri
Expand Up @@ -149,6 +149,11 @@ SOURCES += \
$$PWD/models/ut_vaultfileinfo.cpp \
$$PWD/interfaces/ut_dfmsettings.cpp \
$$PWD/interfaces/ut_dfmviewmanager.cpp \
$$PWD/controllers/ut_bookmarkmanager.cpp
$$PWD/controllers/ut_bookmarkmanager.cpp \
$$PWD/gvfs/ut_mountaskpassworddialog.cpp \
$$PWD/gvfs/ut_mountsecretdiskaskpassworddialog.cpp \
$$PWD/gvfs/ut_qdrive.cpp \
$$PWD/gvfs/ut_gvfsmountmanager.cpp \
$$PWD/gvfs/ut_secretmanager.cpp


0 comments on commit 79473f1

Please sign in to comment.