29#define FILENAME DIRNAME "/file_datafile.txt"
30#define TESTSTR "This is the file data file."
32#define TESTREAD_BLKSIZE 1024
33#define APR_BUFFERSIZE 4096
80 rv =
apr_file_link(
"data/file_datafile.txt",
"data/file_datafile2.txt");
89 rv =
apr_file_link(
"data/does_not_exist.txt",
"data/fake.txt");
473 const char *
fname =
"data/testgets_empty.dat";
500 const char *
fname =
"data/testgets_multiline.dat";
539 const char *
fname =
"data/testgets_small_buf.dat";
584 const char *
fname =
"data/testgets_ungetc.dat";
627 const char *
fname =
"data/testgets_buffered_big.dat";
725 const char *
fname =
"data/modneg.dat";
737 for (
i = 0;
i < 7980;
i++) {
751 for (
i = 0;
i < 10000;
i++) {
782 ABTS_ASSERT(tc,
"File Pointer Mismatch, expected 7990",
cur == 7990);
817#define LINE1 "this is a line of text\n"
818#define LINE2 "this is a second line of text\n"
823 const char *
fname =
"data/testputs.dat";
846 const char *
fname =
"data/testwritev.dat";
888 const char *
fname =
"data/testwritev_full.dat";
924 const char *
fname =
"data/testwritev_buffered.dat";
958 const char *
fname =
"data/testwritev_buffered.dat";
993 const char *
fname =
"data/testtruncate.dat";
1022 ABTS_ASSERT(tc,
"File size mismatch, expected 0 (empty)", finfo.
size == 0);
1032 const char *
fname =
"data/testtruncate.dat";
1088 const char *
fname =
"data/testtruncate.dat";
1135 const char *
fname =
"data/testtruncate_buffered_write.dat";
1182 const char *
fname =
"data/testtruncate_buffered_write2.dat";
1228 const char *
fname =
"data/testtruncate_buffered_read.dat";
1278 const char *
fname =
"data/testbigfprintf.dat";
1310 const char *
fname =
"data/testflush.dat";
1332 ABTS_ASSERT(tc,
"failed to write to read-only buffered fd",
1341 const char *
fname =
"data/testflush.dat";
1361 ABTS_ASSERT(tc,
"read should flush buffered write and fail",
1367 ABTS_ASSERT(tc,
"gets should flush buffered write and fail",
1377 ABTS_ASSERT(tc,
"seek should flush buffered write and fail",
1386 const char *
fname =
"data/testxthread.dat";
1389 char buf[128] = { 0 };
1469#if defined(__APPLE__)
1508 for (
i = 0;
i <
ctx->num_writes;
i++) {
1554 const char *
fname =
"data/testatomic_append.dat";
1575 ctx1.chunksize = 1 +
rand() % 8192;
1577 ctx1.num_writes = 1000;
1583 ctx2.chunksize = 1 +
rand() % 8192;
1585 ctx2.num_writes = 1000;
1604 ABTS_SKIP(tc,
data,
"This test requires APR thread support.");
1612 const char *
fname =
"data/testappend_locked.dat";
1650 const char *
fname =
"data/testlarge_write_buffered.dat";
1691 const char *
fname =
"data/testtwo_large_writes_buffered.dat";
1738 const char *
fname =
"data/testtwo_large_writes_buffered.dat";
1785 const char *
fname =
"data/testwrite_buffered_spanning_over_bufsize.dat";
1832 const char *
fname =
"data/testempty_read_buffered.dat";
1864 const char *
fname =
"data/testlarge_read_buffered.dat";
1912 const char *
fname =
"data/testtwo_large_reads_buffered.dat";
1969 const char *
fname =
"data/testtwo_large_reads_buffered.dat";
2026 const char *
fname =
"data/testread_buffered_spanning_over_bufsize.dat";
2083 const char *
fname =
"data/testsingle_byte_reads_buffered.dat";
2131 const char *
fname =
"data/testtest_read_buffered_seek.dat";
2190 const char *
fname =
"data/testappend_buffered.dat";
const char apr_size_t len
void abts_run_test(abts_suite *ts, test_func f, void *value)
void abts_log_message(const char *fmt,...)
#define ABTS_SIZE_EQUAL(a, b, c)
#define ABTS_PTR_EQUAL(a, b, c)
#define ABTS_PTR_NOTNULL(a, b)
#define ABTS_STR_EQUAL(a, b, c)
#define ABTS_SKIP(tc, data, msg)
#define ABTS_ASSERT(a, b, c)
#define ABTS_INT_EQUAL(a, b, c)
#define APR_ASSERT_SUCCESS(tc, ctxt, rv)
APR Miscellaneous library routines.
APR general purpose library routines.
APR Thread and Process Library.
const unsigned char * buf
#define APR_STATUS_IS_EEXIST(s)
#define APR_STATUS_IS_EACCES(s)
#define APR_STATUS_IS_EBADF(s)
#define APR_STATUS_IS_ENOENT(s)
apr_brigade_flush void * ctx
const char apr_ssize_t int flags
const char int apr_pool_t * pool
apr_seek_where_t apr_off_t * offset
void apr_size_t apr_size_t * bytes_read
const void apr_size_t apr_size_t * bytes_written
#define APR_FLOCK_EXCLUSIVE
#define APR_FOPEN_TRUNCATE
#define APR_FOPEN_XTHREAD
#define APR_FOPEN_BUFFERED
#define APR_FPROT_OS_DEFAULT
apr_vformatter_buff_t * c
#define apr_pool_create(newpool, parent)
#define apr_pcalloc(p, size)
const void apr_size_t bytes
apr_status_t apr_file_lock(apr_file_t *thefile, int type)
apr_status_t apr_file_unlock(apr_file_t *thefile)
apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *pool)
static void test_readzero(abts_case *tc, void *data)
static void test_buffer_set_get(abts_case *tc, void *data)
static void file_contents_equal(abts_case *tc, const char *fname, const void *expect, apr_size_t expectlen)
static void test_seek(abts_case *tc, void *data)
static void test_atomic_append(abts_case *tc, void *data)
static void test_fail_read_flush(abts_case *tc, void *data)
static void test_single_byte_reads_buffered(abts_case *tc, void *data)
static void test_file_trunc_buffered_write2(abts_case *tc, void *data)
static void test_ungetc(abts_case *tc, void *data)
static void test_file_trunc_buffered_read(abts_case *tc, void *data)
abts_suite * testfile(abts_suite *suite)
static void test_mod_neg(abts_case *tc, void *data)
static void test_xthread(abts_case *tc, void *data)
static void test_fail_write_flush(abts_case *tc, void *data)
static void test_small_and_large_reads_buffered(abts_case *tc, void *data)
static void test_two_large_reads_buffered(abts_case *tc, void *data)
static void test_puts(abts_case *tc, void *data)
static void test_open_write(abts_case *tc, void *data)
static void test_open_excl(abts_case *tc, void *data)
static void test_gets_buffered_big(abts_case *tc, void *data)
static void test_open_writecreate(abts_case *tc, void *data)
static void test_datasync_on_file(abts_case *tc, void *data)
static void test_datasync_on_stream(abts_case *tc, void *data)
static void test_append_buffered(abts_case *tc, void *data)
static void test_bigread(abts_case *tc, void *data)
static void test_writev_buffered_seek(abts_case *tc, void *data)
static void test_truncate(abts_case *tc, void *data)
static void test_append_locked(abts_case *tc, void *data)
static void test_gets(abts_case *tc, void *data)
static void test_read_buffered_spanning_over_bufsize(abts_case *tc, void *data)
static void test_read_buffered_seek(abts_case *tc, void *data)
static void test_fileclose(abts_case *tc, void *data)
static void test_gets_ungetc(abts_case *tc, void *data)
static void test_gets_empty(abts_case *tc, void *data)
static void test_userdata_getnokey(abts_case *tc, void *data)
static void test_file_trunc2(abts_case *tc, void *data)
static void test_open_readwrite(abts_case *tc, void *data)
static void test_writev_full(abts_case *tc, void *data)
static void link_nonexisting(abts_case *tc, void *data)
static void test_gets_small_buf(abts_case *tc, void *data)
static void test_file_trunc_buffered_write(abts_case *tc, void *data)
static void test_write_buffered_spanning_over_bufsize(abts_case *tc, void *data)
static void test_getc(abts_case *tc, void *data)
static void test_userdata_get(abts_case *tc, void *data)
static void test_empty_read_buffered(abts_case *tc, void *data)
static void test_open_read(abts_case *tc, void *data)
static void link_existing(abts_case *tc, void *data)
static void test_two_large_writes_buffered(abts_case *tc, void *data)
static void test_userdata_set(abts_case *tc, void *data)
static void test_small_and_large_writes_buffered(abts_case *tc, void *data)
static void test_large_read_buffered(abts_case *tc, void *data)
static void test_filename(abts_case *tc, void *data)
static void test_gets_buffered(abts_case *tc, void *data)
static void test_file_trunc(abts_case *tc, void *data)
static void test_write(abts_case *tc, void *data)
static void test_file_remove(abts_case *tc, void *data)
static void test_writev_buffered(abts_case *tc, void *data)
static void test_bigfprintf(abts_case *tc, void *data)
static void test_large_write_buffered(abts_case *tc, void *data)
static void test_open_noreadwrite(abts_case *tc, void *data)
static void test_writev(abts_case *tc, void *data)
static void test_gets_multiline(abts_case *tc, void *data)
static void test_read(abts_case *tc, void *data)
abts_suite * teststr(abts_suite *suite)
apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray