Skip to content

[Feature] Add tests for streaming basis encoder coverage #1182

@viiccwen

Description

@viiccwen

ref: #1058

What

Add focused tests for qdp/qdp-core/src/encoding/basis.rs.

Current coverage for this file is still zero:

  • Function coverage: 0.00% (0/6)
  • Line coverage: 0.00% (0/108)

Why

The streaming basis encoder contains CPU-side validation that should be stable and easy to verify, but none of it is covered right now.

That includes:

  • invalid sample size handling
  • negative and non-integer basis indices
  • out-of-range basis indices
  • the needs_staging_copy() == false path

How

Add tests under qdp/qdp-core/tests/ that exercise the basis streaming encoder directly.

Suggested coverage targets:

  • assert needs_staging_copy() returns false
  • reject sample_size != 1
  • reject non-finite, negative, fractional, and out-of-range basis indices
  • verify buffer reuse behavior across chunks if practical
  • add one successful encode path for a small valid input

This issue is done when encoding/basis.rs is no longer completely uncovered in cargo llvm-cov.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions