t: port reftable/pq_test.c to the unit testing framework
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest7 patches 1 replyIn review
- v26 patches 1 replySuperseded
- v16 patches 7 repliesSuperseded
Changes in v3 from the cover letter
- Add another cleanup patch for reftable/pq.c
- Change the commit title of the first patch
- Re-introduce a lost newline in the first patch
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | reftable: remove unncessary curly braces in reftable/pq.creftable/ | +4 | 0 replies | |
| 2/7 | reftable: change the type of array indices to 'size_t' in reftable/pq.creftable/ | +6 | 1 reply | |
| 3/7 | t: move reftable/pq_test.c to the unit testing frameworkMakefile t/ t/ | +16 | 0 replies | |
| 4/7 | t-reftable-pq: make merged_iter_pqueue_check() staticreftable/ t/ | +1 | 0 replies | |
| 5/7 | t-reftable-pq: make merged_iter_pqueue_check() callable by referencet/ | +5 | 0 replies | |
| 6/7 | t-reftable-pq: add test for index based comparisont/ | +41 | 0 replies | |
| 7/7 | t-reftable-pq: add tests for merged_iter_pqueue_top()t/ | +49 | 0 replies |
Reviews trailers per patch
None of the 7 patches has a Reviewed-by or Acked-by.
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [GSoC][PATCH v3 0/7] t: port reftable/pq_test.c to the unit testing framework
In the recent codebase update (commit 8bf6fbd, 2023-12-09), a new unit testing framework written entirely in C was introduced to the Git project aimed at simplifying testing and reducing test run times. Currently, tests for the reftable refs-backend are performed by a custom testing framework defined by reftable/test_framework.{c, h}. Port reftable/pq_test.c to the unit testing framework and improve upon the ported test.
The first two patches in the series are preparatory cleanup, the third patch moves the test to the unit testing framework, and the rest of the patches improve upon the ported test.
---
Changes in v3:
- Add another cleanup patch for reftable/pq.c
- Change the commit title of the first patch
- Re-introduce a lost newline in the first patch
CI/PR for v3: https://github.com/gitgitgadget/git/pull/1745
Chandra Pratap(7):
reftable: remove unncessary curly braces in reftable/pq.c
reftable: change the type of array indices to 'size_t' in
t: move reftable/pq_test.c to the unit testing framework
t-reftable-pq: make merged_iter_pqueue_check() static
t-reftable-pq: make merged_iter_pqueue_check() callable
t-reftable-pq: add test for index based comparison
t-reftable-pq: add tests for merged_iter_pqueue_top()
Makefile | 2 +- reftable/pq.c | 29 +++-------- reftable/pq.h | 1 - reftable/pq_test.c | 74 ---------------------------- t/helper/test-reftable.c | 1 - t/unit-tests/t-reftable-pq.c | 155 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 166 insertions(+), 96 deletions(-)
Range-diff against v2:
1: 9ac1035c07 ! 1: d3c5605ea2 reftable: clean up reftable/pq.c
@@ Metadata
Author: Chandra Pratap <[email protected]>
## Commit message ##
- reftable: clean up reftable/pq.c
+ reftable: remove unncessary curly braces in reftable/pq.c
According to Documentation/CodingGuidelines, control-flow statements
with a single line as their body must omit curly braces. Make
@@ reftable/pq.c: struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pque
SWAP(pq->heap[i], pq->heap[min]);
i = min;
}
-@@ reftable/pq.c: struct pq_entry merged_iter_pqueue_remove(struct merged_iter_pqueue *pq)
- void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e)
- {
- int i = 0;
--
- REFTABLE_ALLOC_GROW(pq->heap, pq->len + 1, pq->cap);
- pq->heap[pq->len++] = *e;
-
+@@ reftable/pq.c: void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry
i = pq->len - 1;
while (i > 0) {
int j = (i - 1) / 2;
-: ---------- > 2: 1873fb02ce reftable: change the type of array indices to 'size_t' in reftable/pq.c 2: f24dc84877 = 3: 3cccf8266a t: move reftable/pq_test.c to the unit testing framework 3: ce42fd1288 = 4: 4b63849694 t-reftable-pq: make merged_iter_pqueue_check() static 4: 226d72aa6a = 5: 3698a7189f t-reftable-pq: make merged_iter_pqueue_check() callable by reference 5: 00cb440f11 = 6: d58c8f709e t-reftable-pq: add test for index based comparison 6: dd44486c28 = 7: 69521f0ff7 t-reftable-pq: add tests for merged_iter_pqueue_top()