29 X("array_list::empty", test_al_empty), \
30 X("array_list::push_less_than_32", test_al_push_less_than_32), \
31 X("array_list::push_more_than_32", test_al_push_more_than_32), \
32 X("array_list::tail_to_trie_boundary", test_al_push_tail_to_trie_boundary), \
33 X("array_list::get_out_of_bounds", test_al_get_out_of_bounds), \
34 X("array_list::update", test_al_update), X("array_list::remove", test_al_remove), \
35 X("array_list::remove_out_of_bounds", test_al_remove_out_of_bounds), \
36 X("array_list::remove_drain_and_push", test_al_remove_drain_and_push)
39# define AL_TEST_LOG(...) DBG("AL_TEST", __VA_ARGS__)
41# define AL_TEST_LOG(...)
70 for (
size_t i = 0; i < 31; i++) {
83 for (
size_t i = 0; i < 30; i++) {
103 for (
int i = 0; i < 2000; i++) {
129 for (
int i = 0; i < 2000; i++) {
155 for (
int i = 0; i < 32; i++) {
216 for (
int i = 0; i < 40; i++) {
290 for (
int i = 0; i < 100; i++) {
302 for (
int i = 0; i < 99; i++) {
306 int expected = i < 50 ? i : i + 1;
341 for (
int i = 0; i < 40; i++) {
365 for (
int i = 0; i < 2000; i++) {
372 for (
int i = 0; i < 1990; i++) {
377 for (
int i = 0; i < 10; i++) {
385 for (
int i = 0; i < 2000; i++) {
393 for (
int i = 0; i < 10; i++) {
398 for (
int i = 0; i < 2000; i++) {
array_list_maybe_element_t array_list_get(const array_list_t *al, array_list_index_t n)
Negative index is not supported.
srn_error_t * array_list_update(array_list_t *al, array_list_index_t n, array_list_elem_t x)
Update the given index n of the array list al with the new element x.
srn_error_t * array_list_remove(array_list_t *al, array_list_index_t n)
Remove the element at the given index n from the array list al, shifting every later element down one...
array_list_t array_list_empty(const srn_context_t *ctx)
Create an empty array list in the given context ctx.
srn_error_t * array_list_push(array_list_t *al, array_list_elem_t x)
Push the given element x to the end of array_list al.
A bit-partitioned trie with a tail buffer, used as a growable indexed sequence in the runtime.
static void test_al_remove()
static void test_al_get_out_of_bounds()
static void test_al_remove_drain_and_push()
static void test_al_push_more_than_32()
static void test_al_push_tail_to_trie_boundary()
static void test_al_remove_out_of_bounds()
static void test_al_update()
static void test_al_empty()
static void test_al_push_less_than_32()
#define RELEASE_CONTEXT(x)
#define ASSERT_NOT_NULL(x)
#define SHUTDOWN_ENGINE(mm, engine)
#define MAKE_ENGINE(mm, engine)
#define MAKE_CONTEXT(engine, x)