Skip to content

Add unit tests for low-coverage public header helpers #8290

Description

Problem

The Coverage run 33884132155 at commit d7b19f3 shows several public-header helpers with straightforward missing unit coverage. The coverage-report-html artifact reports line coverage for include/ccf/**.

The opportunities below are limited to pure formatting, parsing, conversion, schema, and small synchronization helpers. They should not require a node, enclave, KV store, or end-to-end test setup.

Opportunities

Priority Public header Current line coverage Obvious unit test Estimated additional covered lines
1 base_endpoint_registry.h 0/54 Table-test every ApiResult and InvalidArgsReason, including an out-of-range value for each default branch 54
2 rest_verb.h 13/63 Exercise string construction, known/unknown methods, ordering, JSON round-trip/type error, and schema helpers 50
3 tx_id.h 22/63 Table-test valid IDs plus missing separator, zero/invalid/trailing view and seqno, and both JSON error paths 41
4 service/tables/proposals.h 0/37 Format every ProposalState and verify an out-of-range state throws 37
5 crypto/pem.h 32/57 Extend pem_test with vector construction, ordering/empty/hash, JSON array/error cases, and schema helpers 25
6 tx_status.h 29/72 Extend tx_status_test to check tx_status_to_str for all values and its default branch 25
7 crypto/san.h 0/23 Parse IP and DNS SANs, parse a list, and reject an unknown prefix 23
8 crypto/curve.h 0/21 Check each valid curve-to-digest mapping plus invalid and out-of-range curve errors 21
9 ds/locking.h and wait 39/46 Check native_handle() and wake the non-predicate ConditionVariable::wait() from a helper thread 7
10 claims_digest.h 29/35 Exercise schema_name and fill_json_schema 6
11 http_status.h 3/6 Check client-error boundaries around 400 and 500 3

Conservative total: approximately 292 additional covered lines.

Estimation method

The estimate counts currently uncovered executable lines in the exact run's LLVM HTML report that the described tests should execute. It is not the total uncovered size of each header. For tx_status.h, the header has 43 uncovered lines overall, but only the 25 confirmed-zero formatter lines are counted because evaluate_tx_status already has extensive unit tests.

A practical first batch is priorities 1-4: approximately 182 lines from table-driven tests over dependency-free enum/string helpers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions