MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_batch

Function check_batch

ccan/ccan/ptr_valid/test/run.c:7–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <sys/mman.h>
6
7static bool check_batch(char *p, unsigned int num, bool expect)
8{
9 struct ptr_valid_batch batch;
10 unsigned int i;
11
12 if (!ptr_valid_batch_start(&batch))
13 return false;
14 for (i = 0; i < num; i++) {
15 if (ptr_valid_batch(&batch, p + i, 1, 1, false) != expect)
16 return false;
17 if (ptr_valid_batch(&batch, p + i, 1, 1, true) != expect)
18 return false;
19 }
20 ptr_valid_batch_end(&batch);
21 return true;
22}
23
24int main(void)
25{

Callers 1

mainFunction · 0.85

Calls 3

ptr_valid_batch_startFunction · 0.85
ptr_valid_batch_endFunction · 0.85
ptr_valid_batchClass · 0.70

Tested by

no test coverage detected