/linux/tools/testing/selftests/bpf/ |
H A D | test_lru_map.c | 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() [all …]
|
H A D | test_lpm_map.c |
|
H A D | test_maps.c | 47 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 51 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() 56 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap() 60 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 65 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 68 assert(bpf_map_lookup_and_delete_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap() 71 assert(bpf_map_lookup_elem(fd, &key, &value) < 0 && errno == ENOENT); in test_hashmap() 74 assert(bpf_map_update_elem(fd, &key, &value, BPF_EXIST) < 0 && in test_hashmap() 79 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap() 85 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() [all …]
|
/linux/tools/testing/selftests/proc/ |
H A D | proc-pid-vm.c | 367 assert(rv == len); in main() 368 assert(memcmp(buf, buf0, strlen(buf0)) == 0); in main() 370 assert(memcmp(buf + strlen(buf0), str_vsyscall, strlen(str_vsyscall)) == 0); in main() 386 assert(0 <= rv && rv <= sizeof(buf)); in main() 388 assert(rv >= strlen(buf0)); in main() 389 assert(memcmp(buf, buf0, strlen(buf0)) == 0); in main() 395 assert(memmem(buf, rv, RSS1, strlen(RSS1)) || in main() 397 assert(memmem(buf, rv, PSS1, strlen(PSS1)) || in main() 413 assert(memmem(buf, rv, S[i], strlen(S[i]))); in main() 417 assert(memmem(buf, rv, str_vsyscall, strlen(str_vsyscall))); in main() [all …]
|
H A D | proc-empty-vm.c | 228 assert(rv == 0); in test_proc_pid_maps() 231 assert(rv == len); in test_proc_pid_maps() 232 assert(memcmp(buf, g_proc_pid_maps_vsyscall, len) == 0); in test_proc_pid_maps() 256 assert(rv == 0); in test_proc_pid_numa_maps() 280 assert(0 <= rv); in test_proc_pid_smaps() 281 assert(rv <= sizeof(buf)); in test_proc_pid_smaps() 284 assert(rv == 0); in test_proc_pid_smaps() 287 assert(rv > len); in test_proc_pid_smaps() 288 assert(memcmp(buf, g_proc_pid_smaps_vsyscall, len) == 0); in test_proc_pid_smaps() 292 assert(memmem(buf, rv, PROTECTION_KEY, strlen(PROTECTION_KEY))); in test_proc_pid_smaps() [all …]
|
H A D | proc-subset-pid.c | 78 assert(d); in main() 89 assert(!dot); in main() 91 assert(de->d_type == DT_DIR); in main() 93 assert(!dot_dot); in main() 95 assert(de->d_type == DT_DIR); in main() 97 assert(!self); in main() 99 assert(de->d_type == DT_LNK); in main() 101 assert(!thread_self); in main() 103 assert(de->d_type == DT_LNK); in main() 107 assert(0); in main() [all …]
|
H A D | fd-002-posix-eq.c | 33 assert(fd0 >= 0); in main() 37 assert(fd1 >= 0); in main() 41 assert(fd2 >= 0); in main() 44 assert(rv == 0); in main() 46 assert(rv == 0); in main() 48 assert(rv == 0); in main() 50 assert(st0.st_dev == st1.st_dev); in main() 51 assert(st0.st_ino == st1.st_ino); in main() 53 assert(st0.st_dev == st2.st_dev); in main() 54 assert(st0.st_ino == st2.st_ino); in main()
|
H A D | fd-001-lookup.c | 40 assert(rv == 0); in test_lookup_pass() 41 assert(S_ISLNK(st.st_mode)); in test_lookup_pass() 50 assert(rv == -1 && errno == ENOENT); in test_lookup_fail() 116 assert(de->d_type == DT_DIR); in main() 117 assert(streq(de->d_name, ".")); in main() 120 assert(de->d_type == DT_DIR); in main() 121 assert(streq(de->d_name, "..")); in main() 129 assert(de->d_type == DT_LNK); in main() 132 assert(*end == '\0'); in main() 133 assert(fd_ull == (unsigned int)fd_ull); in main() [all …]
|
H A D | fd-003-kthread.c | 68 assert(buf[rv - 1] == '\n'); in kernel_thread_fd() 74 assert(p); in kernel_thread_fd() 79 assert(p); in kernel_thread_fd() 82 assert(*end == '\0'); in kernel_thread_fd() 83 assert(flags_ull == (unsigned int)flags_ull); in kernel_thread_fd() 102 assert(d); in test_readdir() 105 assert(streq(de->d_name, ".")); in test_readdir() 106 assert(de->d_type == DT_DIR); in test_readdir() 109 assert(streq(de->d_name, "..")); in test_readdir() 110 assert(de->d_type == DT_DIR); in test_readdir() [all …]
|
/linux/tools/testing/radix-tree/ |
H A D | tag_check.c | 20 assert(item_tag_get(tree, index, tag) == 0); in __simple_checks() 23 assert(item_tag_get(tree, index, tag) == 0); in __simple_checks() 26 assert(ret != 0); in __simple_checks() 28 assert(ret == 1); in __simple_checks() 30 assert(ret != 0); in __simple_checks() 32 assert(ret != 0); in __simple_checks() 35 assert(ret == 0); in __simple_checks() 37 assert(ret != 0); in __simple_checks() 39 assert(ret == 0); in __simple_checks() 67 assert(item_tag_get(&tree, 43, 0) == 0); in extend_checks() [all …]
|
H A D | idr-test.c | 19 assert(item->index == id); in item_idr_free() 28 assert(item->index == id); in item_idr_remove() 38 assert(idr_alloc_cyclic(&idr, DUMMY_PTR, 0, 0x4000, GFP_KERNEL) == 0); in idr_alloc_test() 39 assert(idr_alloc_cyclic(&idr, DUMMY_PTR, 0x3ffd, 0x4000, GFP_KERNEL) == 0x3ffd); in idr_alloc_test() 53 assert(id == item->index); in idr_alloc_test() 81 assert(idr_is_empty(&idr)); in idr_null_test() 83 assert(idr_alloc(&idr, NULL, 0, 0, GFP_KERNEL) == 0); in idr_null_test() 84 assert(!idr_is_empty(&idr)); in idr_null_test() 86 assert(idr_is_empty(&idr)); in idr_null_test() 88 assert(idr_alloc(&idr, NULL, 0, 0, GFP_KERNEL) == 0); in idr_null_test() [all …]
|
H A D | multiorder.c | 48 assert(!err); in multiorder_iteration() 62 assert((xas.xa_index | mask) == (index[i] | mask)); in multiorder_iteration() 63 assert(xas.xa_node->shift == shift); in multiorder_iteration() 64 assert(!radix_tree_is_internal_node(item)); in multiorder_iteration() 65 assert((item->index | mask) == (index[i] | mask)); in multiorder_iteration() 66 assert(item->order == order[i]); in multiorder_iteration() 90 assert(!item_insert_order(xa, index[i], order[i])); in multiorder_tagged_iteration() 92 assert(!xa_marked(xa, XA_MARK_1)); in multiorder_tagged_iteration() 114 assert((xas.xa_index | mask) == (tag_index[i] | mask)); in multiorder_tagged_iteration() 115 assert(!xa_is_internal(item)); in multiorder_tagged_iteration() [all …]
|
/linux/lib/kunit/ |
H A D | assert_test.c | 119 const struct kunit_assert *assert, in validate_assert() argument 129 format_func(assert, &message, stream); in validate_assert() 140 struct kunit_assert assert = {}; in kunit_test_unary_assert_format() local 142 .assert = assert, in kunit_test_unary_assert_format() 150 validate_assert(kunit_unary_assert_format, test, &un_assert.assert, in kunit_test_unary_assert_format() 154 validate_assert(kunit_unary_assert_format, test, &un_assert.assert, in kunit_test_unary_assert_format() 161 struct kunit_assert assert = {}; in kunit_test_ptr_not_err_assert_format() local 163 .assert = assert, in kunit_test_ptr_not_err_assert_format() 173 ¬_err_assert.assert, in kunit_test_ptr_not_err_assert_format() 179 ¬_err_assert.assert, stream, 2, in kunit_test_ptr_not_err_assert_format() [all …]
|
H A D | assert.c | 42 void kunit_fail_assert_format(const struct kunit_assert *assert, in kunit_fail_assert_format() argument 50 void kunit_unary_assert_format(const struct kunit_assert *assert, in kunit_unary_assert_format() argument 56 unary_assert = container_of(assert, struct kunit_unary_assert, assert); in kunit_unary_assert_format() 70 void kunit_ptr_not_err_assert_format(const struct kunit_assert *assert, in kunit_ptr_not_err_assert_format() argument 76 ptr_assert = container_of(assert, struct kunit_ptr_not_err_assert, in kunit_ptr_not_err_assert_format() 77 assert); in kunit_ptr_not_err_assert_format() 116 void kunit_binary_assert_format(const struct kunit_assert *assert, in kunit_binary_assert_format() argument 122 binary_assert = container_of(assert, struct kunit_binary_assert, in kunit_binary_assert_format() 123 assert); in kunit_binary_assert_format() 144 void kunit_binary_ptr_assert_format(const struct kunit_assert *assert, in kunit_binary_ptr_assert_format() argument [all …]
|
/linux/tools/testing/selftests/net/mptcp/ |
H A D | mptcp_sockopt.c | 289 assert(ret < 0); /* 0 size_subflow_data */ in do_getsockopt_bogus_sf_data() 290 assert(olen == sizeof(good_data)); in do_getsockopt_bogus_sf_data() 295 assert(ret == 0); in do_getsockopt_bogus_sf_data() 296 assert(olen == sizeof(good_data)); in do_getsockopt_bogus_sf_data() 297 assert(bd.d.num_subflows == 1); in do_getsockopt_bogus_sf_data() 298 assert(bd.d.size_kernel > 0); in do_getsockopt_bogus_sf_data() 299 assert(bd.d.size_user == 0); in do_getsockopt_bogus_sf_data() 305 assert(ret < 0); /* bogus olen */ in do_getsockopt_bogus_sf_data() 306 assert(olen == _olen); /* must be unchanged */ in do_getsockopt_bogus_sf_data() 312 assert(ret < 0); /* size_kernel not 0 */ in do_getsockopt_bogus_sf_data() [all …]
|
H A D | mptcp_inq.c | 221 assert(nsd <= queued); in wait_for_ack() 255 assert(ret == 4); in connect_one_server() 257 assert(strncmp(buf2, "xmit", 4) == 0); in connect_one_server() 260 assert(ret == (ssize_t)sizeof(len)); in connect_one_server() 270 assert(strncmp(buf2, "huge", 4) == 0); in connect_one_server() 277 assert(ret == (ssize_t)sizeof(total)); in connect_one_server() 298 assert(ret == 4); in connect_one_server() 299 assert(strncmp(buf2, "shut", 4) == 0); in connect_one_server() 304 assert(ret == 1); in connect_one_server() 307 assert(ret == 6); in connect_one_server() [all …]
|
/linux/tools/virtio/ringtest/ |
H A D | main.c | 41 assert(r == sizeof v); in notify() 52 assert(r == sizeof v); in wait_for_notify() 88 assert(!*endptr); in set_affinity() 90 assert(cpu >= 0 && cpu < CPU_SETSIZE); in set_affinity() 97 assert(!ret); in set_affinity() 148 assert(completed <= bufs); in run_guest() 149 assert(started <= bufs); in run_guest() 193 assert(completed <= bufs); in run_host() 303 assert(kickfd >= 0); in main() 305 assert(callfd >= 0); in main() [all …]
|
/linux/include/kunit/ |
H A D | assert.h | 51 typedef void (*assert_format_t)(const struct kunit_assert *assert, 66 struct kunit_assert assert; member 69 void kunit_fail_assert_format(const struct kunit_assert *assert, 84 struct kunit_assert assert; member 89 void kunit_unary_assert_format(const struct kunit_assert *assert, 104 struct kunit_assert assert; member 109 void kunit_ptr_not_err_assert_format(const struct kunit_assert *assert, 139 struct kunit_assert assert; member 145 void kunit_binary_assert_format(const struct kunit_assert *assert, 162 struct kunit_assert assert; member [all …]
|
/linux/tools/testing/selftests/kvm/lib/ |
H A D | sparsebit.c | 366 assert(idx > parentp->idx + MASK_BITS + parentp->num_after - 1); in node_add() 385 assert(prev->num_after > 0); in node_add() 386 assert(n1 < MASK_BITS); in node_add() 387 assert(!(nodep->mask & (1 << n1))); in node_add() 415 assert(s->num_set >= num_set || sparsebit_all_set(s)); in node_rm() 441 assert(nodep == nodep->parent->right); in node_rm() 463 assert(nodep == nodep->parent->right); in node_rm() 481 assert(nodep == nodep->parent->right); in node_rm() 504 assert(!(idx % MASK_BITS)); in node_split() 648 assert(nodep->num_after != 0); in node_reduce() [all …]
|
/linux/tools/virtio/ |
H A D | vringh_test.c | 165 assert(!pipe_ret); in parallel_test() 168 assert(!pipe_ret); in parallel_test() 186 assert(user_addr_offset); in parallel_test() 263 assert(riov.i == riov.used); in parallel_test() 270 assert(wiov.i == wiov.used); in parallel_test() 341 assert(*dbuf == finished - 1); in parallel_test() 343 assert(*dbuf == finished); in parallel_test() 419 assert(*dbuf == finished - 1); in parallel_test() 421 assert(len == 0); in parallel_test() 530 assert(riov.used == 1); in main() [all …]
|
H A D | virtio_test.c | 59 assert(r == sizeof v); in vq_notify() 81 assert(r >= 0); in vhost_vq_setup() 84 assert(r >= 0); in vhost_vq_setup() 87 assert(r >= 0); in vhost_vq_setup() 89 assert(r >= 0); in vhost_vq_setup() 92 assert(r >= 0); in vhost_vq_setup() 95 assert(r >= 0); in vhost_vq_setup() 107 assert(info->vq); in vq_reset() 119 assert(r >= 0); in vq_info_add() 136 assert(dev->buf); in vdev_info_init() [all …]
|
H A D | vhost_net_test.c | 107 assert(dev->sock != -1); in vdev_create_socket() 110 assert(ioctl(dev->sock, SIOCGIFINDEX, &ifr) >= 0); in vdev_create_socket() 115 assert(ioctl(dev->sock, SIOCGIFFLAGS, &ifr) >= 0); in vdev_create_socket() 117 assert(ioctl(dev->sock, SIOCSIFFLAGS, &ifr) >= 0); in vdev_create_socket() 135 assert(ret >= 0); in vdev_send_packet() 145 assert(r == sizeof(v)); in vq_notify() 164 assert(r >= 0); in vhost_vq_setup() 168 assert(r >= 0); in vhost_vq_setup() 171 assert(r >= 0); in vhost_vq_setup() 175 assert(r >= 0); in vhost_vq_setup() [all …]
|
/linux/tools/testing/selftests/powerpc/signal/ |
H A D | sigreturn_vdso.c | 82 assert(sigaction(SIGUSR1, &act, NULL) == 0); in test_sigreturn_vdso() 85 assert(search_proc_maps("[vdso]", &low, &high) == 0); in test_sigreturn_vdso() 90 assert(took_signal == 1); in test_sigreturn_vdso() 95 assert(p != MAP_FAILED); in test_sigreturn_vdso() 96 assert(mremap((void *)low, size, size, MREMAP_MAYMOVE|MREMAP_FIXED, p) != MAP_FAILED); in test_sigreturn_vdso() 97 assert(search_proc_maps("[vdso]", &low, &high) == 0); in test_sigreturn_vdso() 102 assert(took_signal == 2); in test_sigreturn_vdso() 105 assert(munmap((void *)low, size) == 0); in test_sigreturn_vdso() 109 assert(search_proc_maps("[vdso]", &low, &high) != 0); in test_sigreturn_vdso() 112 assert(search_proc_maps("[stack]", &low, &high) == 0); in test_sigreturn_vdso() [all …]
|
/linux/arch/mips/math-emu/ |
H A D | ieee754dp.c | 30 assert(ieee754dp_isnan(x)); in ieee754dp_issnan() 42 assert(ieee754dp_issnan(r)); in ieee754dp_nanxcpt() 89 assert(xm); /* we don't gen exact zeros (probably should) */ in ieee754dp_format() 91 assert((xm >> (DP_FBITS + 1 + 3)) == 0); /* no excess */ in ieee754dp_format() 92 assert(xm & (DP_HIDDEN_BIT << 3)); in ieee754dp_format() 135 assert((xm & (DP_HIDDEN_BIT << 3)) == 0); in ieee754dp_format() 136 assert(xe == DP_EMIN); in ieee754dp_format() 159 assert((xm >> (DP_FBITS + 1)) == 0); /* no excess */ in ieee754dp_format() 160 assert(xe >= DP_EMIN); in ieee754dp_format() 187 assert(xe == DP_EMIN); in ieee754dp_format() [all …]
|
H A D | ieee754sp.c | 30 assert(ieee754sp_isnan(x)); in ieee754sp_issnan() 42 assert(ieee754sp_issnan(r)); in ieee754sp_nanxcpt() 89 assert(xm); /* we don't gen exact zeros (probably should) */ in ieee754sp_format() 91 assert((xm >> (SP_FBITS + 1 + 3)) == 0); /* no excess */ in ieee754sp_format() 92 assert(xm & (SP_HIDDEN_BIT << 3)); in ieee754sp_format() 134 assert((xm & (SP_HIDDEN_BIT << 3)) == 0); in ieee754sp_format() 135 assert(xe == SP_EMIN); in ieee754sp_format() 158 assert((xm >> (SP_FBITS + 1)) == 0); /* no excess */ in ieee754sp_format() 159 assert(xe >= SP_EMIN); in ieee754sp_format() 186 assert(xe == SP_EMIN); in ieee754sp_format() [all …]
|