refactor(greeter): make key methods virtual for testability#1093
Open
deepin-wm wants to merge 4 commits into
Open
refactor(greeter): make key methods virtual for testability#1093deepin-wm wants to merge 4 commits into
deepin-wm wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
f7d498e to
28e77aa
Compare
added 2 commits
July 2, 2026 19:26
Add testability support and unit tests for treeland core modules: - CMakePresets: add excludeLabel for testability - lockscreen: add primaryOutputName() getter - output: make constrainToValidArea public static - xresource: add splitXResourceLine public static - xsettings: add testMode constructor and expose protected methods - backlight: add basePath parameter for test injection - greeterproxy: add testMode constructor, virtual methods, and null guards - rootsurfacecontainer, shellhandler, helper, workspace: add TODO(unit-test) - surfacewrapper: add TODO(unit-test) comment - Add 14 test directories covering core modules
Qt signals cannot be declared virtual — MOC generates non-virtual implementations, so adding virtual to a signal causes undefined behavior when a mock tries to override it (SEGFAULT in test_lockscreen).
28e77aa to
8789080
Compare
added 2 commits
July 2, 2026 20:32
Since switchUser() is no longer virtual (signals cannot be virtual), MockGreeterProxy::switchUser() override causes a compile error. Replace with QSignalSpy to observe the base class signal emission.
When SurfaceContainer is constructed with a null parent, ensureQmlContext() would dereference a null pointer from parentContainer(). Add early return for null. Also update test_lockscreen to pass a non-null parent SurfaceContainer (via QQuickItem constructor path) to avoid triggering ensureQmlContext() with a null parent. Also value-initialize WallpaperWorkspaceConfig in test_wallpaperconfig to silence -Werror=maybe-uninitialized on the Deepin deb build.
785f4da to
4cff91e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make isLocked(), showShutdownView(), setShowShutdownView(), lock(), and switchUser() virtual to allow test subclasses to override behavior without requiring a running DDM connection.
Extracted from #1046. Ref: WM-29