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

Function test_append_nonempty

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

Source from the content-addressed store, hash-verified

125}
126
127static void test_append_nonempty(void)
128{
129 int *arr = tal_arr(NULL, int, 2);
130 arr[0] = 10;
131 arr[1] = 20;
132
133 int more[] = { 30, 40 };
134
135 tal_arr_append(&arr, tal_dup_arr(arr, int, more, ARRAY_SIZE(more), 0));
136
137 assert(tal_count(arr) == 4);
138 assert(arr[0] == 10);
139 assert(arr[1] == 20);
140 assert(arr[2] == 30);
141 assert(arr[3] == 40);
142
143 tal_free(arr);
144}
145
146static void test_appendn_partial(void)
147{

Callers 1

mainFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected