chunk_t data = chunk_from_str("foobar");
bio_reader_t *reader;
- lib->leak_detective->set_state(lib->leak_detective, TRUE);
-
data = chunk_clone(data);
reader = bio_reader_create(data);
reader->destroy(reader);
chunk_free(&data);
-
- ck_assert_int_eq(lib->leak_detective->leaks(lib->leak_detective), 0);
}
END_TEST
chunk_t data = chunk_from_str("foobar");
bio_reader_t *reader;
- lib->leak_detective->set_state(lib->leak_detective, TRUE);
-
data = chunk_clone(data);
reader = bio_reader_create_own(data);
reader->destroy(reader);
-
- ck_assert_int_eq(lib->leak_detective->leaks(lib->leak_detective), 0);
}
END_TEST
bio_writer_t *writer;
chunk_t data1, data2;
- lib->leak_detective->set_state(lib->leak_detective, TRUE);
-
writer = bio_writer_create(0);
writer->write_uint8(writer, 1);
data1 = writer->get_buf(writer);
ck_assert(chunk_equals(data1, data2));
ck_assert(data1.ptr == data2.ptr);
writer->destroy(writer);
-
- ck_assert_int_eq(lib->leak_detective->leaks(lib->leak_detective), 0);
}
END_TEST
bio_writer_t *writer;
chunk_t data1, data2;
- lib->leak_detective->set_state(lib->leak_detective, TRUE);
-
writer = bio_writer_create(0);
writer->write_uint8(writer, 1);
data1 = writer->extract_buf(writer);
writer->destroy(writer);
chunk_free(&data1);
-
- ck_assert_int_eq(lib->leak_detective->leaks(lib->leak_detective), 0);
}
END_TEST