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

Function test_append_take

common/test/run-utils-tal_arr_append.c:208–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static void test_append_take(void)
209{
210 int *arr = tal_arr(NULL, int, 0);
211 int more[] = { 4, 5 };
212 const int *moreptr = tal_dup_arr(NULL, int, more, ARRAY_SIZE(more), 0);
213
214 tal_arr_appendn(&arr, take(moreptr), 1);
215 moreptr = tal_dup_arr(NULL, int, more, ARRAY_SIZE(more), 0);
216 tal_arr_append(&arr, take(moreptr));
217
218 assert(tal_count(arr) == 3);
219 assert(arr[0] == 4);
220 assert(arr[1] == 4);
221 assert(arr[2] == 5);
222
223 tal_free(arr);
224}
225
226int main(int argc, char *argv[])
227{

Callers 1

mainFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected