Skip to content

Conversation

Copy link

Copilot AI commented Nov 24, 2025

Implements comprehensive test suite for src/cuddInit.c to maximize code coverage for DD manager initialization and cleanup.

Coverage Achieved

  • Line coverage: 88.7% (63/71 executable lines)
  • Function coverage: 100% (4/4 functions)

Implementation

Core Initialization Tests

  • Cudd_Init with various parameter combinations (no variables, BDD only, ZDD only, both)
  • Auto-detection when maxMemory=0
  • Custom unique table and cache sizes
  • Large variable counts (50+ variables)

Constant Initialization

  • ADD constants: one, zero, plusinfinity, minusinfinity, background
  • BDD logical zero: Cudd_Not(one)

ZDD Universe Paths

  • cuddZddInitUniv triggered by non-zero numVarsZ
  • cuddZddFreeUniv during manager cleanup
  • ZDD variable access via Cudd_zddIthVar

Cleanup Paths

  • Cudd_Quit with valid manager
  • Cudd_Quit with NULL (null-safety)
  • Cleanup with mixed BDD/ZDD nodes

Projection Functions

  • Variable creation loop (lines 169-172) via numVars > 0
  • Variable indexing correctness

Uncovered Lines

8 lines remain uncovered - all memory allocation failure paths:

  • Line 135: stash allocation failure
  • Lines 166-167: vars allocation failure
  • Lines 229-230, 240-242: ZDD allocation failures

These require malloc injection to test and represent out-of-memory conditions.

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/cuddInit.c and target 100% coverage for the source fıle.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 24, 2025 11:54
…and 100% function coverage

Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Co-authored-by: doganulus <1174212+doganulus@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test cases for src/cuddInit.c to achieve 100% coverage Add comprehensive test coverage for cuddInit.c - achieve 88.7% line coverage Nov 24, 2025
Copilot AI requested a review from doganulus November 24, 2025 12:03
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19633483598

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 5.699%

Totals Coverage Status
Change from base Build 19591722627: 0.7%
Covered Lines: 1687
Relevant Lines: 29604

💛 - Coveralls

@doganulus doganulus marked this pull request as ready for review November 24, 2025 12:34
@doganulus doganulus merged commit 20b1330 into 4.0.0 Nov 24, 2025
37 checks passed
@doganulus doganulus deleted the copilot/add-test-cases-for-cuddinit branch November 24, 2025 18:05
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.

3 participants