Skip to content

Add comprehensive test cases for cuddAddApply.c targeting 90% coverage#85

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

Add comprehensive test cases for cuddAddApply.c targeting 90% coverage#85
doganulus merged 2 commits into4.0.0from
copilot/add-test-cases-for-cuddaddapply

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 30, 2025

Expand test coverage for src/cuddAddApply.c from 18.9% toward the 90% target by adding tests for all ADD apply operators.

Changes

  • Binary operators: Tests for Cudd_addPlus, Cudd_addTimes, Cudd_addThreshold, Cudd_addSetNZ, Cudd_addDivide, Cudd_addMinus, Cudd_addMinimum, Cudd_addMaximum, Cudd_addOneZeroMaximum, Cudd_addDiff, Cudd_addAgreement
  • Logical operators: Tests for Cudd_addOr, Cudd_addNand, Cudd_addNor, Cudd_addXor, Cudd_addXnor
  • Monadic operators: Tests for Cudd_addMonadicApply and Cudd_addLog
  • Recursive paths: Tests exercising cuddAddApplyRecur and cuddAddMonadicApplyRecur with non-constant ADDs

Each operator test covers terminal cases including:

  • Identity elements (zero, one)
  • Special values (plus/minus infinity, background)
  • Equal operands
  • Operand swap paths
  • Constant vs non-constant ADDs
TEST_CASE("Cudd_addThreshold - F >= G", "[cuddAddApply]") {
    DdManager *dd = Cudd_Init(0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0);
    DdNode *c5 = Cudd_addConst(dd, 5.0);
    DdNode *c3 = Cudd_addConst(dd, 3.0);
    Cudd_Ref(c5); Cudd_Ref(c3);
    DdNode *result = Cudd_addApply(dd, Cudd_addThreshold, c5, c3);
    REQUIRE(result == c5);
    // cleanup...
}

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/cuddAddApply.c and target 90% coverage for the source file.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test cases for src/cuddAddApply.c to target 90% coverage Add comprehensive test cases for cuddAddApply.c targeting 90% coverage Nov 30, 2025
Copilot AI requested a review from doganulus November 30, 2025 12:16
@doganulus doganulus marked this pull request as ready for review November 30, 2025 18:11
@doganulus doganulus merged commit 5113007 into 4.0.0 Nov 30, 2025
37 checks passed
@doganulus doganulus deleted the copilot/add-test-cases-for-cuddaddapply 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