34 #define BM_COMMON_STR "bm-majority-algorithm" 119 const char s[] =
"0123456789";
130 const char s[] =
"foobar";
#define M0_ALLOC_ARR(arr, nr)
static void uint128_mul_ut(void)
static void test_forall_exists(void)
M0_INTERNAL bool m0_buf_eq(const struct m0_buf *x, const struct m0_buf *y)
M0_INTERNAL bool m0_uint128_eq(const struct m0_uint128 *u0, const struct m0_uint128 *u1)
static const struct m0_uint128 cmax64
static const struct m0_uint128 three
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
#define m0_exists(var, nr,...)
static const struct m0_uint128 cmax128
M0_INTERNAL bool m0_startswith(const char *prefix, const char *str)
static void uint128_add_ut(void)
static void test_str_startswith(void)
static const struct m0_uint128 zero
static void uint128_mul_check(uint64_t a, uint64_t b, const struct m0_uint128 *c)
uint64_t m0_rnd(uint64_t max, uint64_t *prev)
static void uint128_add_check(const struct m0_uint128 *a, const struct m0_uint128 *b, const struct m0_uint128 *sum)
static void test_majority_tie(void)
m0_time_t m0_time_now(void)
static struct m0_addb2_callback c
M0_INTERNAL void m0_key_val_init(struct m0_key_val *kv, const struct m0_buf *key, const struct m0_buf *val)
static const struct m0_uint128 cmax64_2
static void uint128_mul_check1(uint64_t a, uint64_t b, const struct m0_uint128 *c)
static void test_majority_get(void)
#define m0_forall(var, nr,...)
static const struct m0_uint128 cmax64_1
static const struct m0_uint128 two
#define M0_BUF_INIT_PTR(p)
M0_INTERNAL void m0_uint128_mul64(struct m0_uint128 *res, uint64_t a, uint64_t b)
static void test_majority_dist_val(void)
#define M0_UINT128(hi, lo)
static void test_majority_ident_arr(void)
M0_INTERNAL void * m0_vote_majority_get(struct m0_key_val *arr, uint32_t len, bool(*cmp)(const struct m0_buf *, const struct m0_buf *), uint32_t *vote_nr)
static struct m0_addb2_source * s
M0_INTERNAL void m0_uint128_add(struct m0_uint128 *res, const struct m0_uint128 *a, const struct m0_uint128 *b)
static const struct m0_uint128 one