diff --git a/frame/item/components/appdragwidget.cpp b/frame/item/components/appdragwidget.cpp
index 6ce68dc37..67ef8c56a 100644
--- a/frame/item/components/appdragwidget.cpp
+++ b/frame/item/components/appdragwidget.cpp
@@ -69,6 +69,7 @@ AppDragWidget::AppDragWidget(QWidget *parent)
, m_animOpacity(new QPropertyAnimation(m_object, "opacity", this))
, m_animGroup(new QParallelAnimationGroup(this))
, m_goBackAnim(new QPropertyAnimation(this, "pos", this))
+ , m_dockPosition(Dock::Position::Bottom)
, m_removeTips(new TipsWidget(this))
, m_popupWindow(nullptr)
, m_distanceMultiple(Utils::SettingValue("com.deepin.dde.dock.distancemultiple", "/com/deepin/dde/dock/distancemultiple/", "distance-multiple", 1.5).toDouble())
diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp
index f61be495e..b5cd43cd2 100644
--- a/frame/item/components/appsnapshot.cpp
+++ b/frame/item/components/appsnapshot.cpp
@@ -57,6 +57,7 @@ using namespace Dock;
AppSnapshot::AppSnapshot(const WId wid, QWidget *parent)
: QWidget(parent)
, m_wid(wid)
+ , m_closeAble(false)
, m_isWidowHidden(false)
, m_title(new TipsWidget(this))
, m_waitLeaveTimer(new QTimer(this))
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 75928c0ea..a1682058a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -11,6 +11,11 @@ file(GLOB_RECURSE SRCS "*.h" "*.cpp" "../widgets/*.h" "../widgets/*.cpp")
# 用于测试覆盖率的编译条件
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fsanitize=address -O2")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -O2")
+endif()
+
# 查找gmock的cmake文件
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/tests/cmake/modules)
diff --git a/tests/main.cpp b/tests/main.cpp
index 616839b8b..e51b3d8a8 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -19,6 +19,9 @@
* along with this program. If not, see .
*/
#include
+#ifdef QT_DEBUG
+#include
+#endif
#include "dockapplication.h"
@@ -29,7 +32,7 @@
int main(int argc, char **argv)
{
- // gerrit编译时没有显示器,需要指定环境变量,本地Debug模式编译时不要设置这个宏,导致获取不到显示器相关信息
+ // gerrit编译时没有显示器,需要指定环境变量,本地Debug模式编译时不要设置这个宏,导致获取不到显示器相关信息
#ifndef QT_DEBUG
qputenv("QT_QPA_PLATFORM", "offscreen");
#endif
@@ -40,5 +43,8 @@ int main(int argc, char **argv)
::testing::InitGoogleTest(&argc, argv);
+#ifdef QT_DEBUG
+ __sanitizer_set_report_path("asan.log");
+#endif
return RUN_ALL_TESTS();
}
diff --git a/tests/test-recoverage.sh b/tests/test-recoverage.sh
index da8632f80..67d5b3d39 100755
--- a/tests/test-recoverage.sh
+++ b/tests/test-recoverage.sh
@@ -7,6 +7,9 @@ cd ../
rm -rf $BUILD_DIR
mkdir $BUILD_DIR
cd $BUILD_DIR
+
+cmake -DCMAKE_BUILD_TYPE=Debug ..
+
cmake ../
make -j 16
@@ -20,3 +23,5 @@ lcov -r code.info '*/dbus/*' '*/xcb/*' -o final.info
rm -rf ../../tests/$REPORT_DIR
mkdir -p ../../tests/$REPORT_DIR
genhtml -o ../../tests/$REPORT_DIR final.info
+
+mv asan.log* asan_dde-dock.log