29 X("seq::empty", test_seq_empty), X("seq::push_less_than_32", test_seq_push_less_than_32), \
30 X("seq::push_more_than_32", test_seq_push_more_than_32), \
31 X("seq::branching_push", test_seq_branching_push), \
32 X("seq::branching_promotion", test_seq_branching_promotion)
35# define SEQ_TEST_LOG(...) DBG("SEQ_TEST", __VA_ARGS__)
37# define SEQ_TEST_LOG(...)
89 for (
int i = 0; i < 2000; i++) {
113 for (
int i = 0; i < 2000; i++) {
136 for (
int i = 0; i < 5; i++) {
174 int *vals =
ALLOCN(ctx,
int, 96);
176 for (
int i = 0; i < 96; i++) {
181 int *b1_vals =
ALLOCN(ctx,
int, 33);
182 int *b2_vals =
ALLOCN(ctx,
int, 33);
185 for (
int i = 0; i < 33; i++) {
186 b1_vals[i] = 1000 + i;
187 b2_vals[i] = 2000 + i;
197 for (
int i = 0; i < 96; i++) {
204 for (
int i = 0; i < 33; i++) {
#define RELEASE_CONTEXT(x)
#define ASSERT_NOT_NULL(x)
#define SHUTDOWN_ENGINE(mm, engine)
#define MAKE_ENGINE(mm, engine)
#define MAKE_CONTEXT(engine, x)
#define ALLOCN(ctx, T, N)
seq_t seq_empty(const srn_context_t *ctx)
Create an empty seq pinned to ctx.
seq_lookup_result_t seq_get(const seq_t *seq, size_t n)
Negative index is not supported.
seq_t seq_push(const seq_t *seq, seq_elem_t x)
This is an implementation of bit - partitioned, persistent, immutable sequence For more information,...
void * seq_elem_t
We use generic pointers to refer to internal nodes, leaf nodes and even elements.
static void test_seq_branching_promotion()
Two branches that each promote their own diverging tail into the same root slot must not overwrite ea...
void test_seq_push_more_than_32()
static void test_seq_branching_push()
Two pushes branched off one head must not see each other's element.
void test_seq_push_less_than_32()
static void test_seq_empty()
#define SEQ_TEST_LOG(...)
size_t len
logical length.
seq_node_t * root
NULL means “all data is in tail”
seq_elem_t * tail
small tail array for fast push/pop.
uint16_t tail_len
0..SEQ_BR