本文整理汇总了C++中ABTS_INT_EQUAL函数的典型用法代码示例。如果您正苦于以下问题:C++ ABTS_INT_EQUAL函数的具体用法?C++ ABTS_INT_EQUAL怎么用?C++ ABTS_INT_EQUAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ABTS_INT_EQUAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_mkdir
static void test_mkdir(abts_case *tc, void *data)
{
apr_status_t rv;
apr_finfo_t finfo;
rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_stat(&finfo, "data/testdir", APR_FINFO_TYPE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_INT_EQUAL(tc, APR_DIR, finfo.filetype);
}
示例2: recv0_pollset
static void recv0_pollset(abts_case *tc, void *data)
{
apr_status_t rv;
int lrv;
const apr_pollfd_t *descs = NULL;
recv_msg(s, 0, p, tc);
rv = apr_pollset_poll(pollset, 0, &lrv, &descs);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
ABTS_INT_EQUAL(tc, 0, lrv);
ABTS_PTR_EQUAL(tc, NULL, descs);
}
示例3: test_file_remove
static void test_file_remove(abts_case *tc, void *data)
{
apr_status_t rv;
apr_file_t *filetest = NULL;
rv = apr_file_remove(FILENAME, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_open(&filetest, FILENAME, APR_FOPEN_READ,
APR_FPROT_UREAD | APR_FPROT_UWRITE | APR_FPROT_GREAD, p);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_ENOENT(rv));
}
示例4: test_xthread
static void test_xthread(abts_case *tc, void *data)
{
apr_file_t *f;
const char *fname = "data/testxthread.dat";
apr_status_t rv;
apr_int32_t flags = APR_FOPEN_CREATE|APR_FOPEN_READ|APR_FOPEN_WRITE|APR_FOPEN_APPEND|APR_FOPEN_XTHREAD;
char buf[128] = { 0 };
/* Test for bug 38438, opening file with append + xthread and seeking to
the end of the file resulted in writes going to the beginning not the
end. */
apr_file_remove(fname, p);
APR_ASSERT_SUCCESS(tc, "open test file",
apr_file_open(&f, fname, flags,
APR_UREAD|APR_UWRITE, p));
APR_ASSERT_SUCCESS(tc, "write should succeed",
apr_file_puts("hello", f));
apr_file_close(f);
APR_ASSERT_SUCCESS(tc, "open test file",
apr_file_open(&f, fname, flags,
APR_UREAD|APR_UWRITE, p));
/* Seek to the end. */
{
apr_off_t offset = 0;
rv = apr_file_seek(f, APR_END, &offset);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
APR_ASSERT_SUCCESS(tc, "more writes should succeed",
apr_file_puts("world", f));
/* Back to the beginning. */
{
apr_off_t offset = 0;
rv = apr_file_seek(f, APR_SET, &offset);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
apr_file_read_full(f, buf, sizeof(buf), NULL);
ABTS_STR_EQUAL(tc, "helloworld", buf);
apr_file_close(f);
}
示例5: close_pipe
static void close_pipe(abts_case *tc, void *data)
{
apr_status_t rv;
apr_size_t nbytes = 256;
char buf[256];
rv = apr_file_close(readp);
rv = apr_file_close(writep);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_read(readp, buf, &nbytes);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv));
}
示例6: test_removeall
static void test_removeall(abts_case *tc, void *data)
{
apr_status_t rv;
rv = apr_dir_remove("data/one/two/three", p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_dir_remove("data/one/two", p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_dir_remove("data/one", p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
示例7: test_mkdir_twice
static void test_mkdir_twice(abts_case *tc, void *data)
{
apr_status_t rv;
rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_dir_make("data/testdir", APR_UREAD | APR_UWRITE | APR_UEXECUTE, p);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EEXIST(rv));
rv = apr_dir_remove("data/testdir", p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
示例8: test_seek
static void test_seek(abts_case *tc, void *data)
{
apr_status_t rv;
apr_off_t offset = 5;
apr_size_t nbytes = 256;
char *str = apr_pcalloc(p, nbytes + 1);
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
APR_FOPEN_READ,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv);
rv = apr_file_read(filetest, str, &nbytes);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_SIZE_EQUAL(tc, strlen(TESTSTR), nbytes);
ABTS_STR_EQUAL(tc, TESTSTR, str);
memset(str, 0, nbytes + 1);
rv = apr_file_seek(filetest, SEEK_SET, &offset);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_read(filetest, str, &nbytes);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_SIZE_EQUAL(tc, strlen(TESTSTR) - 5, nbytes);
ABTS_STR_EQUAL(tc, TESTSTR + 5, str);
apr_file_close(filetest);
/* Test for regression of sign error bug with SEEK_END and
buffered files. */
rv = apr_file_open(&filetest, FILENAME,
APR_FOPEN_READ | APR_FOPEN_BUFFERED,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
APR_ASSERT_SUCCESS(tc, "Open test file " FILENAME, rv);
offset = -5;
rv = apr_file_seek(filetest, SEEK_END, &offset);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_SIZE_EQUAL(tc, strlen(TESTSTR) - 5, nbytes);
memset(str, 0, nbytes + 1);
nbytes = 256;
rv = apr_file_read(filetest, str, &nbytes);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_SIZE_EQUAL(tc, 5, nbytes);
ABTS_STR_EQUAL(tc, TESTSTR + strlen(TESTSTR) - 5, str);
apr_file_close(filetest);
}
示例9: make_socket
static void make_socket(apr_socket_t **sock, apr_sockaddr_t **sa,
apr_port_t port, apr_pool_t *p, abts_case *tc)
{
apr_status_t rv;
rv = apr_sockaddr_info_get(sa, "127.0.0.1", APR_UNSPEC, port, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_socket_create(sock, (*sa)->family, SOCK_DGRAM, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_socket_bind((*sock), (*sa));
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
}
示例10: timeout_pollcb
static void timeout_pollcb(abts_case *tc, void *data)
{
apr_status_t rv;
pollcb_baton_t pcb;
POLLCB_PREREQ;
pcb.count = 0;
pcb.tc = tc;
rv = apr_pollcb_poll(pollcb, 1, trigger_pollcb_cb, &pcb);
ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv));
ABTS_INT_EQUAL(tc, 0, pcb.count);
}
示例11: test_getc
static void test_getc(abts_case *tc, void *data)
{
apr_file_t *f = NULL;
apr_status_t rv;
char ch;
rv = apr_file_open(&f, FILENAME, APR_READ, 0, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
apr_file_getc(&ch, f);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_INT_EQUAL(tc, (int)TESTSTR[0], (int)ch);
apr_file_close(f);
}
示例12: list_split_multi
static void list_split_multi(abts_case *tc, void *data)
{
int i;
apr_status_t rv;
apr_array_header_t *pathelts;
pathelts = NULL;
rv = apr_filepath_list_split(&pathelts, path_in, p);
ABTS_PTR_NOTNULL(tc, pathelts);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_INT_EQUAL(tc, parts_out_count, pathelts->nelts);
for (i = 0; i < pathelts->nelts; ++i)
ABTS_STR_EQUAL(tc, parts_out[i], ((char**)pathelts->elts)[i]);
}
示例13: test_dec32
static void test_dec32(abts_case *tc, void *data)
{
apr_uint32_t y32;
int rv;
apr_atomic_set32(&y32, 2);
rv = apr_atomic_dec32(&y32);
ABTS_INT_EQUAL(tc, 1, y32);
ABTS_ASSERT(tc, "atomic_dec returned zero when it shouldn't", rv != 0);
rv = apr_atomic_dec32(&y32);
ABTS_INT_EQUAL(tc, 0, y32);
ABTS_ASSERT(tc, "atomic_dec didn't returned zero when it should", rv == 0);
}
示例14: test_userdata_set
static void test_userdata_set(abts_case *tc, void *data)
{
apr_status_t rv;
apr_file_t *filetest = NULL;
rv = apr_file_open(&filetest, FILENAME,
APR_WRITE,
APR_UREAD | APR_UWRITE | APR_GREAD, p);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
rv = apr_file_data_set(filetest, "This is a test",
"test", apr_pool_cleanup_null);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
apr_file_close(filetest);
}
示例15: send_last_pollset
static void send_last_pollset(abts_case *tc, void *data)
{
apr_status_t rv;
const apr_pollfd_t *descs = NULL;
int num;
send_msg(s, sa, LARGE_NUM_SOCKETS - 1, tc);
rv = apr_pollset_poll(pollset, -1, &num, &descs);
ABTS_INT_EQUAL(tc, APR_SUCCESS, rv);
ABTS_INT_EQUAL(tc, 1, num);
ABTS_PTR_NOTNULL(tc, descs);
ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].desc.s);
ABTS_PTR_EQUAL(tc, s[LARGE_NUM_SOCKETS - 1], descs[0].client_data);
}