Skip to content

test(bdr): unit-test BDR cache accessors (closes #391) - #395

Merged
gg582 merged 2 commits into
c4punks:devfrom
Bhumika-1432006:test/391-bdr-cache
Oct 18, 2026
Merged

gg582 merged 2 commits into
c4punks:devfrom
Bhumika-1432006:test/391-bdr-cache

Conversation

@Bhumika-1432006

Copy link
Copy Markdown
Contributor

What it does

Adds tests/test_bdr_cache.c covering the four cache accessors listed in scripts/ci/api-untested-baseline.txt:

  • cwist_bdr_put_fixed + cwist_bdr_get — stores a fixed response; hit returns the same bytes and length; miss on an unregistered path returns NULL.
  • Method-keyed lookup — the same path registered for GET is not returned for POST.
  • cwist_bdr_get_pinned + cwist_bdr_unpin — pinned hit returns blob; blob stays readable while pin is held; cwist_bdr_unpin(NULL) does not crash; miss returns NULL with a NULL pin.
  • cwist_bdr_set_limits — sets max_bytes smaller than a test entry; asserts no crash on oversized put and on zero-value arguments.

cwist_bdr_create() needs no server — the cache is standalone, per the header.

How verified

make test_bdr_cache

Compiles and exits 0.

python3 scripts/ci/check_api_test_coverage.py

Exits 0; four names removed from scripts/ci/api-untested-baseline.txt.

What this does NOT do

Does not test concurrent or multi-threaded put paths (covered by the existing test_bdr), disk-mode, or the revalidation hook.

@gg582
gg582 merged commit 7d1df8e into c4punks:dev Oct 18, 2026
24 checks passed
gg582 added a commit that referenced this pull request Oct 18, 2026
* test(bdr): unit-test BDR cache accessors put_fixed, get, get_pinned, unpin, set_limits (closes #391)

* test(bdr): drop duplicate assert and restating comments

---------

Co-authored-by: Lee Yunjin <gzblues61@daum.net>
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