From 8a3f76d96457e7c6b46ba59fd07fa9df2b1ad182 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Thu, 15 Oct 2026 11:43:56 +0800 Subject: [PATCH 1/2] chore: Update version to 6.0.74 - update version to 6.0.74 log: update version to 6.0.74 --- debian/changelog | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8938b49c8..01f85c68b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +deepin-devicemanager (6.0.74) unstable; urgency=medium + + * chore: Update version to 6.0.74 + * fix(cpu): Fix CPU vendor info from dmidecode + * fix: correct SPDX copyright year separator to hyphen + * fix: replace busy-wait spin with waitForDone in ThreadPool + * fix: remove m_CoreId check in logicalIsExisted + * fix: use find() to avoid implicit map insert and fix SPDX copyright header + * fix: strip /sys prefix precisely in isPathExisted + * fix: use exact match for dpkg process name in isDpkgLocked + * test(unittest): add unit tests for deepin-devicemanager-server modules + * fix: distinguish ENOENT from lock in isFileLocked + * fix: add TTL cache invalidation for GPU info and update SPDX year + * fix: prevent QMap silent insert and update SPDX year + * test(unittest): enhance tests for ArmGenerator, X86Generator and DBusAnythingInterface + * test(unittest): add unit tests for ArmGenerator and X86Generator + * test(unittest): add unit tests for DetailButton, DetailSeperator and ScrollAreaWidget + * test(unittest): add unit tests for PageDriverInstallInfo and DBusAnythingInterface + * fix: correct target view in setCheckedCBDisnable + + -- zhanghongyuan Thu, 15 Oct 2026 11:43:48 +0800 + deepin-devicemanager (6.0.73) unstable; urgency=medium * chore: Update version to 6.0.73 From 16483efe83b9ea7bbb8ee0af12cf40d05376e0cf Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Fri, 23 Oct 2026 20:36:02 +0800 Subject: [PATCH 2/2] fix: correct GPU memory width regex truncation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: addWidthToMap regex used ([0-9]{2}) which captures exactly 2 digits, truncating 256 to 25 2. Fix: change quantifier from {2} to + to match one or more digits, correctly capturing 256, 128, 64, etc. 3. Impact: NVIDIA GPU width display now shows correct value; 2-digit widths remain unaffected Log: Fixed GPU memory interface width display truncation for 3+ digit values Influence: 1. Test addWidthToMap with 256-bit NVIDIA GPU output 2. Test addWidthToMap with 64-bit NVIDIA GPU output 3. Verify non-NVIDIA GPU early return path unchanged fix: 修复GPU位宽正则截断问题 1. 根因:addWidthToMap 正则使用 ([0-9]{2}) 仅捕获2位 数字,将256截断为25 2. 方案:将量词从 {2} 改为 + 匹配一位或多位数字, 正确捕获256、128、64等任意位数位宽 3. 影响:NVIDIA显卡位宽显示正确;2位数位宽不受影响 Log: 修复NVIDIA显卡位宽显示截断问题 Influence: 1. 测试256位NVIDIA显卡位宽输出 2. 测试64位NVIDIA显卡位宽输出 3. 验证非NVIDIA显卡提前返回路径无变化 PMS: BUG-DEF-001 --- .../src/GenerateDevice/CmdTool.cpp | 2 +- .../src/GenerateDevice/ut_cmdtool_parse.cpp | 44 +++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp b/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp index e655d201c..3f3d496fe 100644 --- a/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp +++ b/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp @@ -742,7 +742,7 @@ void CmdTool::addWidthToMap(QMap &mapInfo) sInfo = process.readAllStandardOutput(); QStringList lines = sInfo.split("\n"); foreach (const QString &line, lines) { - QRegularExpression reg("\\s\\sAttribute\\s'GPUMemoryInterface' \\(.*\\):\\s([0-9]{2}).*"); + QRegularExpression reg("\\s\\sAttribute\\s'GPUMemoryInterface' \\(.*\\):\\s([0-9]+).*"); if (reg.match(line).hasMatch()) { mapInfo.insert("Width", reg.match(line).captured(1) + " bits"); // qCDebug(appLog) << "Found width:" << mapInfo["Width"]; diff --git a/deepin-devicemanager/tests/src/GenerateDevice/ut_cmdtool_parse.cpp b/deepin-devicemanager/tests/src/GenerateDevice/ut_cmdtool_parse.cpp index 731e2a1f9..f65322f09 100644 --- a/deepin-devicemanager/tests/src/GenerateDevice/ut_cmdtool_parse.cpp +++ b/deepin-devicemanager/tests/src/GenerateDevice/ut_cmdtool_parse.cpp @@ -7,10 +7,13 @@ #include "CmdTool.h" #include "ut_Head.h" +#include "stub.h" #include #include #include +#include +#include #include @@ -123,12 +126,47 @@ TEST_F(UT_CmdToolParse, getMulHwinfoInfo) EXPECT_NO_FATAL_FAILURE(tool->getMulHwinfoInfo("block1\nblock2\n")); } -// addWidthToMap -TEST_F(UT_CmdToolParse, addWidthToMap) +// addWidthToMap: 非 NVIDIA 显卡提前返回(不进入正则解析) +TEST_F(UT_CmdToolParse, addWidthToMap_nonNvidia) { QMap m; - m["width"] = "64 bits"; + m["Vendor"] = "Intel Corporation"; EXPECT_NO_FATAL_FAILURE(tool->addWidthToMap(m)); + EXPECT_FALSE(m.contains("Width")); +} + +// QProcess 桩: 模拟 nvidia-settings 输出(256 bits,三位数位宽) +static void ut_addWidth_start(QProcess * /*self*/, const QString & /*p*/, + const QStringList & /*a*/, QIODevice::OpenMode /*m*/) +{ + return; +} +static bool ut_addWidth_wait(QProcess * /*self*/, int /*msecs*/) +{ + return true; +} +static QByteArray ut_addWidth_read(QProcess * /*self*/) +{ + return QByteArray( + " Attribute 'GPUMemoryInterface' (host:0[gpu:0]): 256.\n"); +} + +// addWidthToMap: NVIDIA 显卡,正则正确捕获三位数位宽 256 +TEST_F(UT_CmdToolParse, addWidthToMap_nvidia_256bits) +{ + QMap m; + m["Vendor"] = "NVIDIA Corporation"; + + Stub stub; + stub.set(((void (QProcess::*)(const QString &, const QStringList &, + QIODevice::OpenMode))ADDR(QProcess, start)), + ut_addWidth_start); + stub.set(((bool (QProcess::*)(int))ADDR(QProcess, waitForFinished)), + ut_addWidth_wait); + stub.set(ADDR(QProcess, readAllStandardOutput), ut_addWidth_read); + + tool->addWidthToMap(m); + EXPECT_EQ(m.value("Width"), QString("256 bits")); } // getSMBIOSVersion