Repository navigation
test(Page): supplement PageDriver Install/Backup/Restore unit tests and fix copyright headers - #904
Merged
Merged
Conversation
Supplement ut_pagedriverinstallinfo.cpp from 17 to 30 GTest cases covering all 14 public methods: - addDriverInfoToTableView: cover 4 status branches (NOT_INSTALL/ CAN_UPDATE/DRIVER_IS_NEW/unknown early-return) with per-column widget type and content assertions - showTables: cover all-zero setNoUpdateDriverUI branch, install-only/ update-only/both/new-only visibility and label counts, negative count boundary - updateItemStatus/slotDownloadFinished: verify status sync on both views and error message forwarding via DriverStatusItem::setErrorMsg - slotDownloadProgressChanged: verify 5-arg forwarding to head widget setDownloadUI with two driver types - clearAllData/initTable: verify row reset and header rebuild for all three views - setCheckedCBDisnable: verify disabled checkbox, ST_WAITING status and operation button via direct call and installAll signal path - getCheckedDriverIndex: verify empty table and checked-state driven collection order - declaration table + AAA comments per skill baseline; stubs follow project tests/src/stub.h convention (member Stub, auto-restore)
Supplement ut_pagedriverbackupinfo.cpp from 14 to 24 GTest cases
covering all 11 public methods:
- addDriverInfoToTableView: cover 3 backup-version branches (backable
row with ST_DRIVER_NOT_BACKUP + BACKUP operation, backed-up-only
3-column row, both-views dual insert) and the no-row negative case
- showTables: cover both-zero setNoBackupDriverUI, backable-only/
backedup-only/both-present setBackableDriverUI branches and negative
count boundary
- updateItemStatus: verify ST_DRIVER_BACKUP_FAILED triggers
setErrorMsg("Backup Failed") while success status does not
- clearAllData/initTable: verify row reset and header rebuild on both
views including column widths and header checkbox
- setCheckedCBDisnable: verify disabled checkbox and ST_WAITING status
via direct call and backupAll signal path
- getCheckedDriverIndex/setHeaderCbEnable/initUI: structural and
state-transition assertions
- declaration table + AAA comments per skill baseline; stubs follow
project tests/src/stub.h convention (member Stub, auto-restore)
Supplement ut_pagedriverrestoreinfo.cpp from 8 to 16 GTest cases covering all 9 public methods: - addDriverInfoToTableView: cover backup-version present (4-column row with RESTORE operation) and empty backup-version early-return - showTables: verify stack page switch at backedLength 0/non-zero and negative boundary, plus setRestoreDriverUI forwarding - slotOperatorClicked: drive the real view signal path and verify the operation item is replaced by an ST_DRIVER_RESTORING status item at column 3 with 3-arg signal forwarding - setItemOperationEnable: verify operation button enable/disable round trip via name-index lookup - clearAllData/initTable: verify row reset and header rebuild with column widths and absent header checkbox - initUI: verify two-page DStackedWidget assembly and gotoBackup button wiring; gotoBackup signal emission via button click - declaration table + AAA comments per skill baseline; stubs follow project tests/src/stub.h convention (member Stub, auto-restore)
Remove the stray '~ 2020' / '~ 2026' suffix from the copyright line in 30 unit test files, normalizing to: // Copyright (C) 2019-2026 UnionTech Software Technology Co.,Ltd The malformed range was introduced by earlier header-restore tooling; the year range 2019-2026 still covers the current year, so the SPDX year range check keeps passing.
Reviewer's GuideThis PR substantially increases unit-test coverage for the PageDriver install, backup, and restore flows by adding isolated UI stubs, reusable fixtures, and explicit branch/state/signal assertions, while also standardizing malformed copyright headers across 30 test files; the reported Qt6 debug coverage is 100% for the three target files and all 70 focused tests pass. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
lzwind
approved these changes
Oct 24, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind 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 |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
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.
Summary
PageDriverBackupInfo (14 -> 24) and PageDriverRestoreInfo (8 -> 16);
70 cases total covering all 34 testable public methods
(2019-2026 ~ 2020 -> 2019-2026) in 30 unit test files
Test results
(--gtest_filter='UT_PageDriverInstallInfo.:UT_PageDriverBackupInfo.:UT_PageDriverRestoreInfo.*', offscreen)
Summary by Sourcery
Expand PageDriver unit-test coverage and standardize copyright headers across the test suite.
Enhancements:
Tests:
Chores: