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()
157 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity0()
163 assert(lru_map_fd != -1); in test_lru_sanity0()
166 assert(expected_map_fd != -1); in test_lru_sanity0()
173 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
174 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
178 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
181 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
187 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
190 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity0()
193 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
199 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
205 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity0()
206 assert(value[0] == 1234); in test_lru_sanity0()
209 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
210 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
215 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
219 assert(!bpf_map_lookup_and_delete_elem(lru_map_fd, &key, &value)); in test_lru_sanity0()
220 assert(value[0] == 1234); in test_lru_sanity0()
223 assert(!bpf_map_delete_elem(expected_map_fd, &key)); in test_lru_sanity0()
225 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity0()
254 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity1()
257 assert(batch_size * 2 == tgt_free); in test_lru_sanity1()
261 assert(lru_map_fd != -1); in test_lru_sanity1()
264 assert(expected_map_fd != -1); in test_lru_sanity1()
271 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
277 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity1()
278 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
289 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity1()
291 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity1()
295 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity1()
331 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity2()
334 assert(batch_size * 2 == tgt_free); in test_lru_sanity2()
338 assert(lru_map_fd != -1); in test_lru_sanity2()
341 assert(expected_map_fd != -1); in test_lru_sanity2()
348 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
364 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
366 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity2()
368 assert(bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
378 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity2()
379 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
381 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity2()
382 assert(value[0] == 4321); in test_lru_sanity2()
383 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
395 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
401 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity2()
403 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity2()
407 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity2()
437 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity3()
440 assert(batch_size * 2 == tgt_free); in test_lru_sanity3()
444 assert(lru_map_fd != -1); in test_lru_sanity3()
447 assert(expected_map_fd != -1); in test_lru_sanity3()
454 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
460 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity3()
461 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
471 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity3()
473 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity3()
477 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity3()
496 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity4()
503 assert(lru_map_fd != -1); in test_lru_sanity4()
507 assert(expected_map_fd != -1); in test_lru_sanity4()
512 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
516 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity4()
519 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity4()
520 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
525 assert(!bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
526 assert(bpf_map_delete_elem(lru_map_fd, &key)); in test_lru_sanity4()
531 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity4()
533 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity4()
537 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity4()
550 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, last_key, value)); in do_test_lru_sanity5()
554 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in do_test_lru_sanity5()
555 assert(!bpf_map_lookup_elem_with_ref_bit(map_fd, key, value)); in do_test_lru_sanity5()
558 assert(bpf_map_lookup_elem(map_fd, &last_key, value) == -ENOENT); in do_test_lru_sanity5()
575 assert(map_fd != -1); in test_lru_sanity5()
579 assert(!bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity5()
595 assert(waitpid(pid, &status, 0) == pid); in test_lru_sanity5()
596 assert(status == 0); in test_lru_sanity5()
603 assert(key > 0); in test_lru_sanity5()
622 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity6()
625 assert(expected_map_fd != -1); in test_lru_sanity6()
628 assert(lru_map_fd != -1); in test_lru_sanity6()
633 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
635 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
645 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, in test_lru_sanity6()
648 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
653 assert(!bpf_map_update_elem(lru_map_fd, &key, value, in test_lru_sanity6()
655 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity6()
659 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity6()
685 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity7()
691 assert(lru_map_fd != -1); in test_lru_sanity7()
694 assert(expected_map_fd != -1); in test_lru_sanity7()
701 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
702 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
706 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity7()
713 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
716 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity7()
719 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
725 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
731 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity7()
732 assert(value[0] == 1234); in test_lru_sanity7()
738 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity7()
739 assert(value[0] == 1234); in test_lru_sanity7()
742 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity7()
743 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity7()
748 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity7()
750 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity7()
776 assert(sched_next_online(0, &next_cpu) != -1); in test_lru_sanity8()
782 assert(lru_map_fd != -1); in test_lru_sanity8()
785 assert(expected_map_fd != -1); in test_lru_sanity8()
792 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
795 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity8()
802 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
805 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_EXIST) == -ENOENT); in test_lru_sanity8()
808 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
809 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
816 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
822 assert(!bpf_map_lookup_elem(lru_map_fd, &key, value)); in test_lru_sanity8()
823 assert(value[0] == 1234); in test_lru_sanity8()
829 assert(!bpf_map_lookup_elem_with_ref_bit(lru_map_fd, key, value)); in test_lru_sanity8()
830 assert(value[0] == 1234); in test_lru_sanity8()
833 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity8()
834 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity8()
839 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity8()
841 assert(map_equal(lru_map_fd, expected_map_fd)); in test_lru_sanity8()
859 assert(nr_cpus != -1); in main()