Skip to content

Add comprehensive tests for cuddApa.c (83.3% coverage)#82

Merged
doganulus merged 3 commits into4.0.0from
copilot/add-test-cases-for-cuddapa
Nov 30, 2025
Merged

Add comprehensive tests for cuddApa.c (83.3% coverage)#82
doganulus merged 3 commits into4.0.0from
copilot/add-test-cases-for-cuddapa

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 30, 2025

Added test coverage for the Arbitrary Precision Arithmetic (APA) module. Coverage increased from 17.3% to 83.3%.

Changes

  • 29 test cases covering all exported APA functions:

    • Arithmetic: Cudd_ApaAdd, Cudd_ApaSubtract, Cudd_ApaShortDivision, Cudd_ApaIntDivision, Cudd_ApaShiftRight
    • Comparison: Cudd_ApaCompare, Cudd_ApaCompareRatios
    • Output: Cudd_ApaPrintHex, Cudd_ApaPrintDecimal, Cudd_ApaStringDecimal, Cudd_ApaPrintExponential
    • Minterm: Cudd_ApaCountMinterm, Cudd_ApaPrintMinterm, Cudd_ApaPrintMintermExp, Cudd_ApaPrintDensity
  • Edge cases tested: carry propagation, borrow handling, multi-digit arithmetic, rounding in exponential printing, complemented BDD nodes

Coverage Gap (90% not achievable)

The remaining 53 uncovered lines are defensive error handling:

  • Memory allocation failures (~22 lines)
  • fprintf EOF returns (~10 lines)
  • Dead code in Cudd_ApaPrintExponential (1 line)
  • Internal recursive function error paths (~20 lines)

These require mocking infrastructure not available in Catch2.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Complete test cases for src/cuddApa.c and target 90% coverage for the source file.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits November 30, 2025 06:57
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
…umbers

Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test cases to achieve 90% coverage for cuddApa Add comprehensive tests for cuddApa.c (83.3% coverage) Nov 30, 2025
Copilot AI requested a review from doganulus November 30, 2025 07:12
@doganulus doganulus marked this pull request as ready for review November 30, 2025 11:19
@doganulus doganulus merged commit 4b29cc4 into 4.0.0 Nov 30, 2025
45 of 74 checks passed
@doganulus doganulus deleted the copilot/add-test-cases-for-cuddapa branch November 30, 2025 19:39
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.

2 participants