Lines Matching defs:bio

12 #include <openssl/bio.h>
19 BIO *bio;
24 bio = BIO_new(BIO_s_mem());
25 if (!TEST_ptr(bio))
30 BIO_set_mem_buf(bio, &bufmem, BIO_NOCLOSE);
31 BIO_set_flags(bio, BIO_FLAGS_MEM_RDONLY);
32 if (!TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(str)))
39 BIO_free(bio);
46 BIO *bio = NULL;
49 bio = BIO_new(BIO_s_mem());
50 if (!TEST_ptr(bio))
52 if (!TEST_int_eq(BIO_puts(bio, "Hello World\n"), 12))
54 BIO_get_mem_ptr(bio, &bufmem);
57 if (!TEST_int_gt(BIO_set_close(bio, BIO_NOCLOSE), 0))
59 BIO_free(bio);
60 bio = NULL;
66 BIO_free(bio);
74 BIO *bio;
78 bio = BIO_new_mem_buf("Hello World\n", 12);
79 if (!TEST_ptr(bio))
81 if (!TEST_int_eq(BIO_read(bio, data, 5), 5))
85 if (!TEST_int_gt(BIO_get_mem_ptr(bio, &bufmem), 0))
87 if (!TEST_int_lt(BIO_write(bio, "test", 4), 0))
89 if (!TEST_int_eq(BIO_read(bio, data, 16), 7))
93 if (!TEST_int_gt(BIO_reset(bio), 0))
95 if (!TEST_int_eq(BIO_read(bio, data, 16), 12))
102 BIO_free(bio);
109 BIO *bio, *bio2 = NULL;
113 bio = BIO_new_mem_buf("Hello World\n", 12);
114 if (!TEST_ptr(bio))
116 if (!TEST_int_eq(BIO_read(bio, data, 5), 5))
120 if (!TEST_int_gt(BIO_get_mem_ptr(bio, &bufmem), 0))
122 (void)BIO_set_close(bio, BIO_NOCLOSE);
143 BIO_free(bio);
151 BIO *bio = NULL;
154 bio = BIO_new(BIO_s_mem());
155 if (!TEST_ptr(bio))
157 if (!TEST_int_eq(BIO_puts(bio, "Hello World\n"), 12))
160 BIO_set_flags(bio, BIO_FLAGS_MEM_RDONLY);
161 if (!TEST_int_eq(BIO_read(bio, data, 16), 12))
165 if (!TEST_int_gt(BIO_reset(bio), 0))
168 BIO_clear_flags(bio, BIO_FLAGS_MEM_RDONLY);
169 if (!TEST_int_eq(BIO_puts(bio, "Hi!\n"), 4))
171 if (!TEST_int_eq(BIO_read(bio, data, 16), 16))
180 BIO_free(bio);
187 BIO *bio = NULL;
190 bio = BIO_new(BIO_s_mem());
191 if (!TEST_ptr(bio))
193 if (!TEST_int_eq(BIO_puts(bio, "Hello World\n"), 12))
196 BIO_set_flags(bio, BIO_FLAGS_NONCLEAR_RST);
198 if (!TEST_int_eq(BIO_read(bio, data, 16), 12))
202 if (!TEST_int_gt(BIO_reset(bio), 0))
205 if (!TEST_int_eq(BIO_read(bio, data, 16), 12))
210 BIO_clear_flags(bio, BIO_FLAGS_NONCLEAR_RST);
211 if (!TEST_int_gt(BIO_reset(bio), 0))
214 if (!TEST_int_lt(BIO_read(bio, data, 16), 1))
220 BIO_free(bio);
225 static long BIO_error_callback(BIO *bio, int cmd, const char *argp,
240 BIO *bio = NULL, *out = NULL;
245 if (!TEST_ptr(bio = BIO_new(BIO_s_mem())))
251 BIO_set_mem_buf(bio, &bufmem, BIO_NOCLOSE);
252 BIO_set_flags(bio, BIO_FLAGS_MEM_RDONLY);
253 BIO_set_callback_ex(bio, BIO_error_callback);
264 if (!TEST_false(i2d_ASN1_bio_stream(out, (ASN1_VALUE*) p7, bio,
275 BIO_free(bio);