test: revive a non-redundant subset of DocumentManagerTest.cpp#234
Merged
Conversation
The tests in mxtest/api/DocumentManagerTest.cpp had been disabled under #if 0 and were written against an older api where createFromScore returned a plain int and getData returned a plain ScoreData. Update them to the current Result-based DocumentManager api and re-enable a focused subset. Kept the coverage that nothing else provides: - DocumentManager handle lifecycle (destroy -> getDocument == nullptr) - golden metadata extraction from the Dichterliebe reference file - identification/encoding round-trips via the public stream api - <supports> round-trips (no other unit test, and none of the corpus files using <supports> are in the api-roundtrip baseline) - page-margin both/odd/even coalescing Dropped the parts already covered by PageDataTest, CreditRoundTripTest, and the corpus api-roundtrip regression (defaults layout sweeps and the PageTextData credit round-trip), plus the pure-arithmetic tenthsPer* accessor checks. Fixed the tenthsPerInch constant the original carried (160 was computed from the wrong millimeters value). Closes #100
gen-quality
|
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 78.0% | 5860 / 7509 |
| Functions | 61.9% | 1957 / 3159 |
| Branches | 47.3% | 4931 / 10419 |
Core HTML report | API HTML report
Commit f0e5a6164f1cb3a70afa911e2c67eaa40f1d574f.
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
The tests in
mxtest/api/DocumentManagerTest.cpphad been disabled under#if 0and were written against an older api wherecreateFromScorereturned a plainintandgetDatareturned a plainScoreData. They were updated to the currentResult-basedDocumentManagerapi and a focused subset was re-enabled.Rather than reviving all of the original tests wholesale, this keeps only the coverage that nothing else provides and drops the parts that already overlap other suites:
Kept (33 tests):
destroyDocumentthengetDocumentreturnsnullptr)<supports>round-trips, which no other unit test covers and which the corpus api-roundtrip baseline does not exercise (none of the corpus files using<supports>are in the pinned list)Dropped:
PageDataTestand the corpus api-roundtrip regressionPageTextDatacredit round-trip already covered byCreditRoundTripTesttenthsPerMillimeter/tenthsPerInchaccessor checksAlso fixed a bug the original carried:
tenthsPerInchexpected160, which was computed from the wrong millimeters value (6.35 rather than ActorPrelude's 3.9956). The correct value is254.27970767844627.Testing
*DocumentManager*: 142 assertions in 33 test cases passmake devbuilds cleanmake fmtappliedReferences