Skip to content

Add comprehensive tests for cuddAddIte.c targeting 90% coverage#84

Merged
doganulus merged 2 commits into4.0.0from
copilot/complete-test-cases-src-cuddaddite
Nov 30, 2025
Merged

Add comprehensive tests for cuddAddIte.c targeting 90% coverage#84
doganulus merged 2 commits into4.0.0from
copilot/complete-test-cases-src-cuddaddite

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 30, 2025

Adds test coverage for src/cuddAddIte.c which implements ADD ITE operations and related functions. Initial coverage was 8.6%.

Changes

  • Cudd_addIte tests: Constant selectors (f=0, f=1), g==h case, ITE(F,1,0)=F shortcut, addVarToConst conversions (f==g, f==h), F=(x,1,0) and F=(x,0,1) shortcuts
  • Cudd_addIteConstant tests: Trivial cases, constant g/h returning DD_NON_CONSTANT, recursive paths with cache hits
  • Cudd_addEvalConst tests: Terminal cases (f=1, f=0, g constant), recursive cases with Fv==zero and Fnv!=zero branches
  • Cudd_addCmpl tests: Complement of 0/1/non-zero constants, complex ADDs, cache hit verification
  • Cudd_addLeq tests: f==g, constant comparisons, PLUS/MINUS_INFINITY edge cases, recursive cofactor traversal
  • cuddAddIteRecur/cuddAddCmplRecur tests: t==e optimization, topf>v cofactor case
SECTION("ITE(F,1,0) returns F") {
    DdNode *var0 = Cudd_addIthVar(manager, 0);
    Cudd_Ref(var0);
    DdNode *result = Cudd_addIte(manager, var0, one, zero);
    REQUIRE(result == var0);
    Cudd_RecursiveDeref(manager, var0);
}
Original prompt

Complete test cases for src/cuddAddIte.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.

Copilot AI self-assigned this Nov 30, 2025
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test cases for src/cuddAddIte.c to achieve 90% coverage Add comprehensive tests for cuddAddIte.c targeting 90% coverage Nov 30, 2025
Copilot AI requested a review from doganulus November 30, 2025 09:34
@doganulus doganulus marked this pull request as ready for review November 30, 2025 13:17
@doganulus doganulus merged commit 011aafa into 4.0.0 Nov 30, 2025
49 of 74 checks passed
@doganulus doganulus deleted the copilot/complete-test-cases-src-cuddaddite 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