Lines Matching refs:assert

59 	assert(node);  in tlpm_add()
133 assert(0); in tlpm_delete()
143 assert(!tlpm_match(list, (uint8_t[]){ 0xff }, 8)); in test_lpm_basic()
146 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff }, 8)); in test_lpm_basic()
147 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff, 0xff }, 16)); in test_lpm_basic()
148 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff, 0x00 }, 16)); in test_lpm_basic()
149 assert(!tlpm_match(list, (uint8_t[]){ 0x7f }, 8)); in test_lpm_basic()
150 assert(!tlpm_match(list, (uint8_t[]){ 0xfe }, 8)); in test_lpm_basic()
151 assert(!tlpm_match(list, (uint8_t[]){ 0xff }, 7)); in test_lpm_basic()
154 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff }, 8)); in test_lpm_basic()
155 assert(t2 == tlpm_match(list, (uint8_t[]){ 0xff, 0xff }, 16)); in test_lpm_basic()
156 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff, 0xff }, 15)); in test_lpm_basic()
157 assert(!tlpm_match(list, (uint8_t[]){ 0x7f, 0xff }, 16)); in test_lpm_basic()
160 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff }, 8)); in test_lpm_basic()
161 assert(t1 == tlpm_match(list, (uint8_t[]){ 0xff, 0xff }, 16)); in test_lpm_basic()
164 assert(!tlpm_match(list, (uint8_t[]){ 0xff }, 8)); in test_lpm_basic()
195 assert(!t1 == !t2); in test_lpm_order()
197 assert(t1->n_bits == t2->n_bits); in test_lpm_order()
199 assert((t1->key[j / 8] & (1 << (7 - j % 8))) == in test_lpm_order()
242 assert(map >= 0); in test_lpm_map()
254 assert(!r); in test_lpm_map()
266 assert(!r || errno == ENOENT); in test_lpm_map()
267 assert(!t == !!r); in test_lpm_map()
271 assert(t->n_bits == value[keysize]); in test_lpm_map()
273 assert((t->key[j / 8] & (1 << (7 - j % 8))) == in test_lpm_map()
290 assert(!r); in test_lpm_map()
292 assert(list); in test_lpm_map()
303 assert(!r || errno == ENOENT); in test_lpm_map()
304 assert(!t == !!r); in test_lpm_map()
308 assert(t->n_bits == value[keysize]); in test_lpm_map()
310 assert((t->key[j / 8] & (1 << (7 - j % 8))) == in test_lpm_map()
350 assert(map_fd_ipv4 >= 0); in test_lpm_ipaddr()
355 assert(map_fd_ipv6 >= 0); in test_lpm_ipaddr()
361 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
366 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
371 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
376 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
381 assert(bpf_map_update_elem(map_fd_ipv4, key_ipv4, &value, 0) == 0); in test_lpm_ipaddr()
386 assert(bpf_map_update_elem(map_fd_ipv6, key_ipv6, &value, 0) == 0); in test_lpm_ipaddr()
394 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
395 assert(value == 3); in test_lpm_ipaddr()
398 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == 0); in test_lpm_ipaddr()
399 assert(value == 2); in test_lpm_ipaddr()
402 assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == 0); in test_lpm_ipaddr()
403 assert(value == 0xdeadbeef); in test_lpm_ipaddr()
406 assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == 0); in test_lpm_ipaddr()
407 assert(value == 0xdeadbeef); in test_lpm_ipaddr()
411 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT); in test_lpm_ipaddr()
414 assert(bpf_map_lookup_elem(map_fd_ipv4, key_ipv4, &value) == -ENOENT); in test_lpm_ipaddr()
417 assert(bpf_map_lookup_elem(map_fd_ipv6, key_ipv6, &value) == -ENOENT); in test_lpm_ipaddr()
437 assert(map_fd >= 0); in test_lpm_delete()
454 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
459 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
464 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
469 assert(bpf_map_update_elem(map_fd, key, &value, 0) == 0); in test_lpm_delete()
474 assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT); in test_lpm_delete()
478 assert(bpf_map_delete_elem(map_fd, key) == -ENOENT); in test_lpm_delete()
482 assert(bpf_map_delete_elem(map_fd, key) == -ENOENT); in test_lpm_delete()
487 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
488 assert(value == 2); in test_lpm_delete()
493 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
497 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
498 assert(value == 1); in test_lpm_delete()
503 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
507 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
508 assert(value == 1); in test_lpm_delete()
513 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
517 assert(bpf_map_lookup_elem(map_fd, key, &value) == 0); in test_lpm_delete()
518 assert(value == 3); in test_lpm_delete()
523 assert(bpf_map_delete_elem(map_fd, key) == 0); in test_lpm_delete()
527 assert(bpf_map_lookup_elem(map_fd, key, &value) == -ENOENT); in test_lpm_delete()
545 assert(map_fd >= 0); in test_lpm_get_next_key()
548 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == -ENOENT); in test_lpm_get_next_key()
553 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
556 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
557 assert(key_p->prefixlen == 16 && key_p->data[0] == 192 && in test_lpm_get_next_key()
560 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT); in test_lpm_get_next_key()
564 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
565 assert(key_p->prefixlen == 16 && key_p->data[0] == 192 && in test_lpm_get_next_key()
571 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
574 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
575 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 && in test_lpm_get_next_key()
579 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
580 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
584 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT); in test_lpm_get_next_key()
589 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
592 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
593 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 && in test_lpm_get_next_key()
597 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
598 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
602 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
603 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
607 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT); in test_lpm_get_next_key()
612 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
615 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
616 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 && in test_lpm_get_next_key()
620 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
621 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
625 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
626 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
630 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
631 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
635 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT); in test_lpm_get_next_key()
640 assert(bpf_map_update_elem(map_fd, key_p, &value, 0) == 0); in test_lpm_get_next_key()
643 assert(bpf_map_get_next_key(map_fd, NULL, key_p) == 0); in test_lpm_get_next_key()
644 assert(key_p->prefixlen == 24 && key_p->data[0] == 192 && in test_lpm_get_next_key()
648 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
649 assert(next_key_p->prefixlen == 28 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
654 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
655 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
659 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
660 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
664 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
665 assert(next_key_p->prefixlen == 16 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
669 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == -ENOENT); in test_lpm_get_next_key()
674 assert(bpf_map_get_next_key(map_fd, key_p, next_key_p) == 0); in test_lpm_get_next_key()
675 assert(next_key_p->prefixlen == 24 && next_key_p->data[0] == 192 && in test_lpm_get_next_key()
711 assert(bpf_map_update_elem(info->map_fd, key_p, &value, 0) == 0); in lpm_test_command()
714 assert(ret == 0 || errno == ENOENT); in lpm_test_command()
718 assert(ret == 0 || errno == ENOENT); in lpm_test_command()
722 assert(ret == 0 || errno == ENOENT || errno == ENOMEM); in lpm_test_command()
764 assert(pthread_create(&thread_id[i], NULL, &lpm_test_command, &info[i]) == 0); in test_lpm_multi_thread()
768 assert(pthread_join(thread_id[i], &ret) == 0 && ret == (void *)&info[i]); in test_lpm_multi_thread()