Lines Matching full:assert

10 #include <assert.h>
85 assert(!bpf_map_lookup_elem(mfd, &zero, value)); in bpf_map_lookup_elem_with_ref_bit()
100 assert(!bpf_map_lookup_elem(map1, &next_key, value1)); in map_subset()
170 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity0()
176 assert(lru_map_fd != -1); in test_lru_sanity0()
179 assert(expected_map_fd != -1); in test_lru_sanity0()
186 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
187 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
191 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
194 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
200 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
203 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0()
206 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
212 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
218 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity0()
219 assert(value[0] == 1234); in test_lru_sanity0()
222 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
223 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
228 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
232 assert(!bpf_map_lookup_and_delete_elem(lru_map_fd, &key, &value)); in test_lru_sanity0()
233 assert(value[0] == 1234); in test_lru_sanity0()
236 assert(!bpf_map_delete_elem(expected_map_fd, &key)); in test_lru_sanity0()
238 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity0()
267 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity1()
270 assert(batch_size * 2 == tgt_free); in test_lru_sanity1()
274 assert(lru_map_fd != -1); in test_lru_sanity1()
277 assert(expected_map_fd != -1); in test_lru_sanity1()
284 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
290 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity1()
291 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
303 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
305 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
309 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity1()
336 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity2()
339 assert(batch_size * 2 == tgt_free); in test_lru_sanity2()
343 assert(lru_map_fd != -1); in test_lru_sanity2()
346 assert(expected_map_fd != -1); in test_lru_sanity2()
353 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
368 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
370 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity2()
372 assert(bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
381 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity2()
382 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
384 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity2()
385 assert(value[0] == 4321); in test_lru_sanity2()
386 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
399 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
405 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
407 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
411 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity2()
441 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity3()
447 assert(lru_map_fd != -1); in test_lru_sanity3()
450 assert(expected_map_fd != -1); in test_lru_sanity3()
457 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
463 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity3()
464 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
472 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
474 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
478 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity3()
497 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity4()
505 assert(lru_map_fd != -1); in test_lru_sanity4()
509 assert(expected_map_fd != -1); in test_lru_sanity4()
514 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
518 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity4()
521 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity4()
522 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
527 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
528 assert(bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
533 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
535 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
539 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity4()
552 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, last_key, value)); in do_test_lru_sanity5()
556 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in do_test_lru_sanity5()
557 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, key, value)); in do_test_lru_sanity5()
560 assert(bpf_map_lookup_elem(map_fd, &last_key, value) == -ENOENT); in do_test_lru_sanity5()
577 assert(map_fd != -1); in test_lru_sanity5()
581 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity5()
597 assert(waitpid(pid, &status, 0) == pid); in test_lru_sanity5()
598 assert(status == 0); in test_lru_sanity5()
605 assert(key > 0); in test_lru_sanity5()
624 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity6()
627 assert(expected_map_fd != -1); in test_lru_sanity6()
630 assert(lru_map_fd != -1); in test_lru_sanity6()
635 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
637 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
647 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, in test_lru_sanity6()
650 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
655 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
657 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
661 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity6()
687 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity7()
693 assert(lru_map_fd != -1); in test_lru_sanity7()
696 assert(expected_map_fd != -1); in test_lru_sanity7()
703 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
704 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
708 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity7()
715 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
718 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity7()
721 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
727 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
733 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity7()
734 assert(value[0] == 1234); in test_lru_sanity7()
740 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity7()
741 assert(value[0] == 1234); in test_lru_sanity7()
744 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
745 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
750 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
752 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity7()
778 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity8()
784 assert(lru_map_fd != -1); in test_lru_sanity8()
787 assert(expected_map_fd != -1); in test_lru_sanity8()
794 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
797 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity8()
804 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
807 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity8()
810 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
811 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
818 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
824 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity8()
825 assert(value[0] == 1234); in test_lru_sanity8()
831 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity8()
832 assert(value[0] == 1234); in test_lru_sanity8()
835 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
836 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
841 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
843 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity8()
861 assert(nr_cpus != -1); in main()