Lines Matching refs:p1
30 struct sshbuf *p1; in sshbuf_tests() local
37 p1 = sshbuf_new(); in sshbuf_tests()
38 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
42 ASSERT_SIZE_T_GT(sshbuf_max_size(p1), 0); in sshbuf_tests()
46 ASSERT_SIZE_T_GT(sshbuf_avail(p1), 0); in sshbuf_tests()
50 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_tests()
54 ASSERT_INT_EQ(sshbuf_set_max_size(p1, 65536), 0); in sshbuf_tests()
55 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), 65536); in sshbuf_tests()
59 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 65536); in sshbuf_tests()
63 sshbuf_free(p1); in sshbuf_tests()
67 p1 = sshbuf_new(); in sshbuf_tests()
68 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
69 ASSERT_INT_EQ(sshbuf_consume(p1, 0), 0); in sshbuf_tests()
70 ASSERT_INT_EQ(sshbuf_consume(p1, 1), SSH_ERR_MESSAGE_INCOMPLETE); in sshbuf_tests()
71 sshbuf_free(p1); in sshbuf_tests()
75 p1 = sshbuf_new(); in sshbuf_tests()
76 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
77 ASSERT_INT_EQ(sshbuf_consume_end(p1, 0), 0); in sshbuf_tests()
78 ASSERT_INT_EQ(sshbuf_consume_end(p1, 1), SSH_ERR_MESSAGE_INCOMPLETE); in sshbuf_tests()
79 sshbuf_free(p1); in sshbuf_tests()
83 p1 = sshbuf_new(); in sshbuf_tests()
84 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
85 r = sshbuf_reserve(p1, 1, &dp); in sshbuf_tests()
89 r = sshbuf_reserve(p1, 3, &dp); in sshbuf_tests()
98 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
102 cdp = sshbuf_ptr(p1); in sshbuf_tests()
111 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
112 ASSERT_INT_EQ(sshbuf_consume(p1, 0), 0); in sshbuf_tests()
113 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
114 r = sshbuf_consume(p1, 64); in sshbuf_tests()
116 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
117 ASSERT_INT_EQ(sshbuf_consume(p1, 1), 0); in sshbuf_tests()
118 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 3); in sshbuf_tests()
119 cdp = sshbuf_ptr(p1); in sshbuf_tests()
120 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
122 ASSERT_INT_EQ(sshbuf_consume(p1, 2), 0); in sshbuf_tests()
123 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_tests()
124 cdp = sshbuf_ptr(p1); in sshbuf_tests()
125 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
127 r = sshbuf_consume(p1, 2); in sshbuf_tests()
129 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_tests()
130 ASSERT_INT_EQ(sshbuf_consume(p1, 1), 0); in sshbuf_tests()
131 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_tests()
132 r = sshbuf_consume(p1, 1); in sshbuf_tests()
134 sshbuf_free(p1); in sshbuf_tests()
138 p1 = sshbuf_new(); in sshbuf_tests()
139 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
140 r = sshbuf_reserve(p1, 4, &dp); in sshbuf_tests()
147 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
148 r = sshbuf_consume_end(p1, 5); in sshbuf_tests()
150 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 4); in sshbuf_tests()
151 ASSERT_INT_EQ(sshbuf_consume_end(p1, 3), 0); in sshbuf_tests()
152 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1); in sshbuf_tests()
153 cdp = sshbuf_ptr(p1); in sshbuf_tests()
156 r = sshbuf_consume_end(p1, 2); in sshbuf_tests()
158 ASSERT_INT_EQ(sshbuf_consume_end(p1, 1), 0); in sshbuf_tests()
159 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_tests()
160 sshbuf_free(p1); in sshbuf_tests()
164 p1 = sshbuf_new(); in sshbuf_tests()
165 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
166 ASSERT_INT_EQ(sshbuf_set_max_size(p1, 1223), 0); in sshbuf_tests()
167 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), 1223); in sshbuf_tests()
168 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 1223); in sshbuf_tests()
169 r = sshbuf_reserve(p1, 1223, &dp); in sshbuf_tests()
173 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1223); in sshbuf_tests()
174 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 0); in sshbuf_tests()
175 r = sshbuf_reserve(p1, 1, &dp); in sshbuf_tests()
181 ASSERT_INT_EQ(sshbuf_consume(p1, 223), 0); in sshbuf_tests()
182 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1000); in sshbuf_tests()
183 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 223); in sshbuf_tests()
184 r = sshbuf_reserve(p1, 224, &dp); in sshbuf_tests()
187 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1000); in sshbuf_tests()
188 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 223); in sshbuf_tests()
189 r = sshbuf_reserve(p1, 223, &dp); in sshbuf_tests()
193 cdp = sshbuf_ptr(p1); in sshbuf_tests()
200 r = sshbuf_set_max_size(p1, 1000); in sshbuf_tests()
203 ASSERT_INT_EQ(sshbuf_set_max_size(p1, sz), 0); in sshbuf_tests()
204 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), sz); in sshbuf_tests()
205 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), sz - 1223); in sshbuf_tests()
206 ASSERT_INT_EQ(sshbuf_len(p1), 1223); in sshbuf_tests()
211 r = sshbuf_reserve(p1, 1, &dp); in sshbuf_tests()
215 cdp = sshbuf_ptr(p1); in sshbuf_tests()
220 ASSERT_SIZE_T_EQ(sshbuf_alloc(p1) % SSHBUF_SIZE_INC, 0); in sshbuf_tests()
221 sshbuf_free(p1); in sshbuf_tests()
225 p1 = sshbuf_new(); in sshbuf_tests()
226 ASSERT_PTR_NE(p1, NULL); in sshbuf_tests()
227 ASSERT_INT_EQ(sshbuf_set_max_size(p1, 1223), 0); in sshbuf_tests()
228 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), 1223); in sshbuf_tests()
229 r = sshbuf_reserve(p1, 1223, &dp); in sshbuf_tests()
233 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 1223); in sshbuf_tests()
234 sshbuf_reset(p1); in sshbuf_tests()
235 ASSERT_SIZE_T_EQ(sshbuf_max_size(p1), 1223); in sshbuf_tests()
236 ASSERT_SIZE_T_EQ(sshbuf_len(p1), 0); in sshbuf_tests()
237 ASSERT_SIZE_T_EQ(sshbuf_avail(p1), 1223); in sshbuf_tests()
238 sshbuf_free(p1); in sshbuf_tests()