Lines Matching +full:1 +full:p1
23 #define NUM_FUZZ_TESTS (1 << 18)
30 struct sshbuf *p1; in sshbuf_fuzz_tests() local
43 p1 = sshbuf_new(); in sshbuf_fuzz_tests()
44 ASSERT_INT_EQ(sshbuf_set_max_size(p1, 16 * 1024), 0); in sshbuf_fuzz_tests()
45 ASSERT_PTR_NE(p1, NULL); in sshbuf_fuzz_tests()
46 ASSERT_PTR_NE(sshbuf_ptr(p1), NULL); in sshbuf_fuzz_tests()
47 ASSERT_MEM_ZERO_NE(sshbuf_ptr(p1), sshbuf_len(p1)); in sshbuf_fuzz_tests()
54 sz = sshbuf_avail(p1); in sshbuf_fuzz_tests()
55 sz2 = sshbuf_len(p1); in sshbuf_fuzz_tests()
56 ret = sshbuf_reserve(p1, r, &dp); in sshbuf_fuzz_tests()
60 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), sz); in sshbuf_fuzz_tests()
61 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2); in sshbuf_fuzz_tests()
65 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), sz - r); in sshbuf_fuzz_tests()
66 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2 + r); in sshbuf_fuzz_tests()
67 memset(dp, arc4random_uniform(255) + 1, r); in sshbuf_fuzz_tests()
77 sz = sshbuf_avail(p1); in sshbuf_fuzz_tests()
78 sz2 = sshbuf_len(p1); in sshbuf_fuzz_tests()
80 ret = ((arc4random() & 1) ? in sshbuf_fuzz_tests()
81 sshbuf_consume : sshbuf_consume_end)(p1, r); in sshbuf_fuzz_tests()
84 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), sz); in sshbuf_fuzz_tests()
85 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2); in sshbuf_fuzz_tests()
88 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), sz + r); in sshbuf_fuzz_tests()
89 ASSERT_SIZE_T_EQ(sshbuf_len(p1), sz2 - r); in sshbuf_fuzz_tests()
98 sz = sshbuf_max_size(p1); in sshbuf_fuzz_tests()
99 if (sshbuf_set_max_size(p1, r) < 0) in sshbuf_fuzz_tests()
100 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), sz); in sshbuf_fuzz_tests()
102 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), r); in sshbuf_fuzz_tests()
106 ASSERT_PTR_NE(sshbuf_ptr(p1), NULL); in sshbuf_fuzz_tests()
107 ASSERT_MEM_ZERO_NE(sshbuf_ptr(p1), sshbuf_len(p1)); in sshbuf_fuzz_tests()
108 sshbuf_free(p1); in sshbuf_fuzz_tests()
109 p1 = sshbuf_new(); in sshbuf_fuzz_tests()
110 ASSERT_PTR_NE(p1, NULL); in sshbuf_fuzz_tests()
111 ASSERT_INT_EQ(sshbuf_set_max_size(p1, in sshbuf_fuzz_tests()
118 r <<= 1; in sshbuf_fuzz_tests()
119 r |= arc4random() & 1; in sshbuf_fuzz_tests()
124 ASSERT_PTR_NE(sshbuf_ptr(p1), NULL); in sshbuf_fuzz_tests()
125 ASSERT_SIZE_T_LE(sshbuf_max_size(p1), 16 * 1024); in sshbuf_fuzz_tests()
127 ASSERT_PTR_NE(sshbuf_ptr(p1), NULL); in sshbuf_fuzz_tests()
128 ASSERT_MEM_ZERO_NE(sshbuf_ptr(p1), sshbuf_len(p1)); in sshbuf_fuzz_tests()
129 sshbuf_free(p1); in sshbuf_fuzz_tests()