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()
158 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity0()
164 assert(lru_map_fd != -1); in test_lru_sanity0()
167 assert(expected_map_fd != -1); in test_lru_sanity0()
174 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
175 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
179 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
182 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
188 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
191 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0()
194 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
200 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
206 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity0()
207 assert(value[0] == 1234); in test_lru_sanity0()
210 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
211 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
216 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
220 assert(!bpf_map_lookup_and_delete_elem(lru_map_fd, &key, &value)); in test_lru_sanity0()
221 assert(value[0] == 1234); in test_lru_sanity0()
224 assert(!bpf_map_delete_elem(expected_map_fd, &key)); in test_lru_sanity0()
226 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity0()
255 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity1()
258 assert(batch_size * 2 == tgt_free); in test_lru_sanity1()
262 assert(lru_map_fd != -1); in test_lru_sanity1()
265 assert(expected_map_fd != -1); in test_lru_sanity1()
272 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
278 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity1()
279 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
290 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
292 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
296 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity1()
332 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity2()
335 assert(batch_size * 2 == tgt_free); in test_lru_sanity2()
339 assert(lru_map_fd != -1); in test_lru_sanity2()
342 assert(expected_map_fd != -1); in test_lru_sanity2()
349 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
365 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
367 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity2()
369 assert(bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
379 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity2()
380 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
382 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity2()
383 assert(value[0] == 4321); in test_lru_sanity2()
384 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
396 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
402 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
404 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
408 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity2()
438 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity3()
441 assert(batch_size * 2 == tgt_free); in test_lru_sanity3()
445 assert(lru_map_fd != -1); in test_lru_sanity3()
448 assert(expected_map_fd != -1); in test_lru_sanity3()
455 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
461 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity3()
462 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()
504 assert(lru_map_fd != -1); in test_lru_sanity4()
508 assert(expected_map_fd != -1); in test_lru_sanity4()
513 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
517 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity4()
520 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity4()
521 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
526 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
527 assert(bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
532 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
534 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
538 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity4()
551 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, last_key, value)); in do_test_lru_sanity5()
555 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in do_test_lru_sanity5()
556 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, key, value)); in do_test_lru_sanity5()
559 assert(bpf_map_lookup_elem(map_fd, &last_key, value) == -ENOENT); in do_test_lru_sanity5()
576 assert(map_fd != -1); in test_lru_sanity5()
580 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity5()
596 assert(waitpid(pid, &status, 0) == pid); in test_lru_sanity5()
597 assert(status == 0); in test_lru_sanity5()
604 assert(key > 0); in test_lru_sanity5()
623 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity6()
626 assert(expected_map_fd != -1); in test_lru_sanity6()
629 assert(lru_map_fd != -1); in test_lru_sanity6()
634 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
636 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
646 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, in test_lru_sanity6()
649 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
654 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
656 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
660 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity6()
686 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity7()
692 assert(lru_map_fd != -1); in test_lru_sanity7()
695 assert(expected_map_fd != -1); in test_lru_sanity7()
702 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
703 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
707 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity7()
714 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
717 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity7()
720 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
726 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
732 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity7()
733 assert(value[0] == 1234); in test_lru_sanity7()
739 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity7()
740 assert(value[0] == 1234); in test_lru_sanity7()
743 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
744 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
749 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
751 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity7()
777 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity8()
783 assert(lru_map_fd != -1); in test_lru_sanity8()
786 assert(expected_map_fd != -1); in test_lru_sanity8()
793 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
796 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity8()
803 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
806 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity8()
809 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
810 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
817 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
823 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity8()
824 assert(value[0] == 1234); in test_lru_sanity8()
830 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity8()
831 assert(value[0] == 1234); in test_lru_sanity8()
834 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
835 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
840 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
842 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity8()
860 assert(nr_cpus != -1); in main()