feat: 添加单元测试用例

测试任务栏图标大小是否正确。

Log: 添加测试用例。
Change-Id: I64a3a786d40e28c17b8ae2dd07bc14a1a9313cf0
Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/4176
Reviewed-by: <mailman@uniontech.com>
Reviewed-by: niecheng <niecheng@uniontech.com>
Reviewed-by: fanpengcheng <fanpengcheng@uniontech.com>
Tested-by: <mailman@uniontech.com>
This commit is contained in:
Zhang Qipeng 2020-09-01 16:22:09 +08:00 committed by zhangqipeng
parent fe81d638a5
commit c215b286e2
2 changed files with 14 additions and 0 deletions

View File

@ -277,6 +277,19 @@ void DockUnitTest::dock_coreDump_check()
delete process;
}
/**
* @brief DockUnitTest::dock_appIconSize_check
* dbus和gsettings获取的任务栏图标大小是否一致
*/
void DockUnitTest::dock_appIconSize_check()
{
DBusDock *dockInter = new DBusDock("com.deepin.dde.daemon.Dock", "/com/deepin/dde/daemon/Dock", QDBusConnection::sessionBus(), this);
QGSettings *setting = new QGSettings("com.deepin.dde.dock");
unsigned int iconSize = dockInter->iconSize();
qDebug() << "Please check the size of icons:" << iconSize;
QCOMPARE(iconSize, setting->get("icon-size").toUInt());
}
QTEST_APPLESS_MAIN(DockUnitTest)
#include "dock_unit_test.moc"

View File

@ -54,6 +54,7 @@ private slots:
void dock_frontWindowRect_check(); // 检查FrontendWindowRect接口数据是否正确
void dock_multi_process(); // 检查是否正常启动
void dock_coreDump_check(); // dock是否一直崩溃
void dock_appIconSize_check(); // 图标大小检查
};
#endif // DOCK_UNIT_TEST_H