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

Function test_featurebits_or

common/test/run-features.c:112–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112static void test_featurebits_or(void)
113{
114 u8 *f1 = tal_arr(tmpctx, u8, 0);
115 u8 *f2 = tal_arr(tmpctx, u8, 0);
116 u8 *control = tal_arr(tmpctx, u8, 0);
117 for (size_t i = 0; i < 100; i += 3) {
118 set_feature_bit(&f1, i);
119 set_feature_bit(&control, i);
120 }
121
122 for (size_t i = 0; i < 10; i += 2) {
123 set_feature_bit(&f2, i);
124 set_feature_bit(&control, i);
125 }
126 u8 *result = featurebits_or(tmpctx, take(f1), f2);
127 assert(tal_arr_eq(result, control));
128}
129
130static bool feature_set_eq(const struct feature_set *f1,
131 const struct feature_set *f2)

Callers 1

mainFunction · 0.85

Calls 2

set_feature_bitFunction · 0.85
featurebits_orFunction · 0.85

Tested by

no test coverage detected