Skip to content

[6230] 放宽附件菜单收起高度断言的舍入容差 - #4762

Merged
PinkMagicFly merged 1 commit into
mainfrom
pigmagicfly/6230/popup-resize-test-rounding
Oct 26, 2026
Merged

PinkMagicFly merged 1 commit into
mainfrom
pigmagicfly/6230/popup-resize-test-rounding

Conversation

@PinkMagicFly

Copy link
Copy Markdown
Contributor

任务

6230:修复 #4760 合并后 macOS CI 的测试失败(runs/40265514650)。

失败现象

qt_chat_controller_test 的 test_attach_menu_popup_resizes_when_attached_expanded 在 macOS-14 CI 上失败:收起「已添加」后 Popup 高度为 232,与展开前记录的 231 差 1px;本地整数缩放下 41/41 通过。

根因

Popup 初始高度来自 popup->adjustSize()(layout sizeHint 的舍入),展开/收起后的高度来自 syncPopupSize 的 qRound(implicitHeight)。当 implicitHeight 为非整数时(CI 无头环境的缩放),两条尺寸路径的舍入结果可差 1px。属断言过严,不是行为回归。

修复

  • 恢复断言放宽为 ±1px 舍入容差(QTRY_VERIFY (qAbs (popup->height () - collapsedHeight) <= 1))。
  • 展开增高、底边锚定断言保持不变。

验证

  • xmake b qt_chat_controller_test && xmake r qt_chat_controller_test:41/41 通过
  • gf fmt --check、git diff --check:通过

🤖 Generated with Claude Code

@PinkMagicFly
PinkMagicFly merged commit 90167f7 into main Oct 26, 2026
6 checks passed
@PinkMagicFly
PinkMagicFly deleted the pigmagicfly/6230/popup-resize-test-rounding branch October 26, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant