Daily Test Coverage Improver: Add comprehensive API polynomial tests #7905
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
This PR adds comprehensive test coverage for Z3's polynomial subresultants API function, achieving 93% coverage for the
src/api/api_polynomial.cppmodule, which previously had 0% test coverage.Problem Found
The polynomial subresultants API function (
Z3_polynomial_subresultants) had zero test coverage despite being an important functionality for algebraic computation:src/api/api_polynomial.cpp: 0% coverage (0/33 lines covered)Actions Taken
src/test/api_polynomial.cppsrc/test/main.cppandsrc/test/CMakeLists.txtTest Coverage Results
Before:
src/api/api_polynomial.cpp: 0% coverage (0/33 lines)After:
src/api/api_polynomial.cpp: 93% coverage (31/33 lines) - +31 lines coveredCoverage improvement achieved: Nearly complete coverage of polynomial subresultants API function with comprehensive testing of basic functionality and edge cases.
Replicating the Test Coverage Measurements
Build and run the new test:
Expected Output:
Commands to install dependencies, build, run tests, and generate coverage reports:
Future Improvement Areas
Based on remaining 0% coverage areas for other API modules:
src/api/api_datalog.cpp(0% coverage, 486 lines) - Datalog API functionssrc/api/api_fpa.cpp(0% coverage, 1090 lines) - Floating-point arithmetic APIsrc/api/api_qe.cpp(0% coverage, 112 lines) - Quantifier elimination APIsrc/api/api_stats.cpp(0% coverage, 83 lines) - Statistics API functions<details>
<summary>Workflow Details</summary>
Bash Commands Run
git checkout -b daily-test-improver-api-polynomial-testsninja -C build test-z3./build/test-z3 api_polynomialgcovr --merge-mode-functions=separate --gcov-ignore-parse-errors --gcov-executable "llvm-cov gcov" . | grep api_polynomialgit add src/test/api_polynomial.cpp src/test/main.cpp src/test/CMakeLists.txtgit commit --author "Daily Test Coverage Improver <github-actions[bot]@users.noreply.github.com>" -m "..."Web Searches Performed
None
Web Pages Fetched
None
</details>
> AI-generated content by Daily Test Coverage Improver may contain mistakes.