${LDFLAGS} -o $@ hash_test.@O@ \
${ISCLIBS} ${LIBS}
-heap_test@EXEEXT@: heap_test.@O@ ${ISCDEPLIBS}
+heap_test@EXEEXT@: heap_test.@O@ isctest.@O@ ${ISCDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
- ${LDFLAGS} -o $@ heap_test.@O@ \
+ ${LDFLAGS} -o $@ heap_test.@O@ isctest.@O@ \
${ISCLIBS} ${LIBS}
hmac_test@EXEEXT@: hmac_test.@O@ ${ISCDEPLIBS}
${LDFLAGS} -o $@ hmac_test.@O@ \
${ISCLIBS} ${LIBS}
-ht_test@EXEEXT@: ht_test.@O@ ${ISCDEPLIBS}
+ht_test@EXEEXT@: ht_test.@O@ isctest.@O@ ${ISCDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
- ${LDFLAGS} -o $@ ht_test.@O@ \
+ ${LDFLAGS} -o $@ ht_test.@O@ isctest.@O@ \
${ISCLIBS} ${LIBS}
-lex_test@EXEEXT@: lex_test.@O@ ${ISCDEPLIBS}
+lex_test@EXEEXT@: lex_test.@O@ isctest.@O@ ${ISCDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
- ${LDFLAGS} -o $@ lex_test.@O@ \
+ ${LDFLAGS} -o $@ lex_test.@O@ isctest.@O@ \
${ISCLIBS} ${LIBS}
md_test@EXEEXT@: md_test.@O@ ${ISCDEPLIBS}
UNUSED(state);
b = NULL;
- result = isc_buffer_allocate(mctx, &b, 1024);
+ result = isc_buffer_allocate(test_mctx, &b, 1024);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(b->length, 1024);
UNUSED(state);
b = NULL;
- result = isc_buffer_allocate(mctx, &b, last_length);
+ result = isc_buffer_allocate(test_mctx, &b, last_length);
assert_int_equal(result, ISC_R_SUCCESS);
assert_non_null(b);
assert_int_equal(b->length, last_length);
UNUSED(state);
- result = isc_buffer_allocate(mctx, &b, sizeof(data));
+ result = isc_buffer_allocate(test_mctx, &b, sizeof(data));
assert_int_equal(result, ISC_R_SUCCESS);
/*
* Prepare a buffer with auto-reallocation enabled.
*/
b = NULL;
- result = isc_buffer_allocate(mctx, &b, 0);
+ result = isc_buffer_allocate(test_mctx, &b, 0);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_setautorealloc(b, true);
UNUSED(state);
- result = isc_counter_create(mctx, 0, &counter);
+ result = isc_counter_create(test_mctx, 0, &counter);
assert_int_equal(result, ISC_R_SUCCESS);
for (i = 0; i < 10; i++) {
#include <isc/mem.h>
#include <isc/util.h>
+#include "isctest.h"
+
+static int
+_setup(void **state) {
+ isc_result_t result;
+
+ UNUSED(state);
+
+ result = isc_test_begin(NULL, true, 0);
+ assert_int_equal(result, ISC_R_SUCCESS);
+
+ return (0);
+}
+
+static int
+_teardown(void **state) {
+ UNUSED(state);
+
+ isc_test_end();
+
+ return (0);
+}
+
struct e {
unsigned int value;
unsigned int index;
/* test isc_heap_delete() */
static void
isc_heap_delete_test(void **state) {
- isc_mem_t *mctx = NULL;
isc_heap_t *heap = NULL;
isc_result_t result;
struct e e1 = { 100, 0 };
UNUSED(state);
- isc_mem_create(&mctx);
-
- result = isc_heap_create(mctx, compare, idx, 0, &heap);
+ result = isc_heap_create(test_mctx, compare, idx, 0, &heap);
assert_int_equal(result, ISC_R_SUCCESS);
assert_non_null(heap);
isc_heap_destroy(&heap);
assert_int_equal(heap, NULL);
-
- isc_mem_detach(&mctx);
- assert_int_equal(mctx, NULL);
}
int
cmocka_unit_test(isc_heap_delete_test),
};
- return (cmocka_run_group_tests(tests, NULL, NULL));
+ return (cmocka_run_group_tests(tests, _setup, _teardown));
}
#else /* HAVE_CMOCKA */
#include <isc/string.h>
#include <isc/util.h>
+#include "isctest.h"
+
+static int
+_setup(void **state) {
+ isc_result_t result;
+
+ UNUSED(state);
+
+ result = isc_test_begin(NULL, true, 0);
+ assert_int_equal(result, ISC_R_SUCCESS);
+
+ return (0);
+}
+
+static int
+_teardown(void **state) {
+ UNUSED(state);
+
+ isc_test_end();
+
+ return (0);
+}
+
+
static void
test_ht_full(int bits, uintptr_t count) {
isc_ht_t *ht = NULL;
isc_result_t result;
- isc_mem_t *mctx = NULL;
uintptr_t i;
- isc_mem_create(&mctx);
-
- result = isc_ht_init(&ht, mctx, bits);
+ result = isc_ht_init(&ht, test_mctx, bits);
assert_int_equal(result, ISC_R_SUCCESS);
assert_non_null(ht);
isc_ht_destroy(&ht);
assert_null(ht);
-
- isc_mem_detach(&mctx);
}
static void
test_ht_iterator() {
isc_ht_t *ht = NULL;
isc_result_t result;
- isc_mem_t *mctx = NULL;
isc_ht_iter_t * iter = NULL;
uintptr_t i;
uintptr_t count = 10000;
unsigned char key[16];
size_t tksize;
- isc_mem_create(&mctx);
-
- result = isc_ht_init(&ht, mctx, 16);
+ result = isc_ht_init(&ht, test_mctx, 16);
assert_int_equal(result, ISC_R_SUCCESS);
assert_non_null(ht);
for (i = 1; i <= count; i++) {
isc_ht_destroy(&ht);
assert_null(ht);
-
- isc_mem_detach(&mctx);
}
/* 20 bit, 200K elements test */
cmocka_unit_test(isc_ht_iterator_test),
};
- return (cmocka_run_group_tests(tests, NULL, NULL));
+ return (cmocka_run_group_tests(tests, _setup, _teardown));
}
#else /* HAVE_CMOCKA */
#include "isctest.h"
-isc_mem_t *mctx = NULL;
-isc_log_t *lctx = NULL;
+isc_mem_t *test_mctx = NULL;
+isc_log_t *test_lctx = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_timermgr_t *timermgr = NULL;
isc_socketmgr_t *socketmgr = NULL;
workers = atoi(p);
}
- CHECK(isc_taskmgr_create(mctx, workers, 0, NULL, &taskmgr));
+ CHECK(isc_taskmgr_create(test_mctx, workers, 0, NULL, &taskmgr));
CHECK(isc_task_create(taskmgr, 0, &maintask));
isc_taskmgr_setexcltask(taskmgr, maintask);
- CHECK(isc_timermgr_create(mctx, &timermgr));
- CHECK(isc_socketmgr_create(mctx, &socketmgr));
- netmgr = isc_nm_start(mctx, 3);
+ CHECK(isc_timermgr_create(test_mctx, &timermgr));
+ CHECK(isc_socketmgr_create(test_mctx, &socketmgr));
+ netmgr = isc_nm_start(test_mctx, 3);
return (ISC_R_SUCCESS);
cleanup:
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
- INSIST(mctx == NULL);
- isc_mem_create(&mctx);
+ INSIST(test_mctx == NULL);
+ isc_mem_create(&test_mctx);
if (logfile != NULL) {
isc_logdestination_t destination;
isc_logconfig_t *logconfig = NULL;
- INSIST(lctx == NULL);
- CHECK(isc_log_create(mctx, &lctx, &logconfig));
+ INSIST(test_lctx == NULL);
+ CHECK(isc_log_create(test_mctx, &test_lctx, &logconfig));
- isc_log_registercategories(lctx, categories);
- isc_log_setcontext(lctx);
+ isc_log_registercategories(test_lctx, categories);
+ isc_log_setcontext(test_lctx);
destination.file.stream = logfile;
destination.file.name = NULL;
cleanup_managers();
- if (lctx != NULL) {
- isc_log_destroy(&lctx);
+ if (test_lctx != NULL) {
+ isc_log_destroy(&test_lctx);
}
- if (mctx != NULL) {
- isc_mem_destroy(&mctx);
+ if (test_mctx != NULL) {
+ isc_mem_destroy(&test_mctx);
}
test_running = false;
goto cleanup; \
} while (0)
-extern isc_mem_t *mctx;
-extern isc_log_t *lctx;
+extern isc_mem_t *test_mctx;
+extern isc_log_t *test_lctx;
extern isc_taskmgr_t *taskmgr;
extern isc_timermgr_t *timermgr;
extern isc_socketmgr_t *socketmgr;
#include <isc/mem.h>
#include <isc/util.h>
+#include "isctest.h"
+
+static int
+_setup(void **state) {
+ isc_result_t result;
+
+ UNUSED(state);
+
+ result = isc_test_begin(NULL, true, 0);
+ assert_int_equal(result, ISC_R_SUCCESS);
+
+ return (0);
+}
+
+static int
+_teardown(void **state) {
+ UNUSED(state);
+
+ isc_test_end();
+
+ return (0);
+}
+
/* check handling of 0xff */
static void
lex_0xff(void **state) {
- isc_mem_t *mctx = NULL;
isc_result_t result;
isc_lex_t *lex = NULL;
isc_buffer_t death_buf;
UNUSED(state);
- isc_mem_create(&mctx);
-
- result = isc_lex_create(mctx, 1024, &lex);
+ result = isc_lex_create(test_mctx, 1024, &lex);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&death_buf, &death[0], sizeof(death));
assert_int_equal(result, ISC_R_SUCCESS);
isc_lex_destroy(&lex);
-
- isc_mem_destroy(&mctx);
}
/* check setting of source line */
static void
lex_setline(void **state) {
- isc_mem_t *mctx = NULL;
isc_result_t result;
isc_lex_t *lex = NULL;
unsigned char text[] = "text\nto\nbe\nprocessed\nby\nlexer";
UNUSED(state);
- isc_mem_create(&mctx);
-
- result = isc_lex_create(mctx, 1024, &lex);
+ result = isc_lex_create(test_mctx, 1024, &lex);
assert_int_equal(result, ISC_R_SUCCESS);
isc_buffer_init(&buf, &text[0], sizeof(text));
assert_int_equal(line, 105U);
isc_lex_destroy(&lex);
-
- isc_mem_destroy(&mctx);
}
int
cmocka_unit_test(lex_setline),
};
- return (cmocka_run_group_tests(tests, NULL, NULL));
+ return (cmocka_run_group_tests(tests, _setup, _teardown));
}
#else /* HAVE_CMOCKA */
void *items1[50];
void *items2[50];
void *tmp;
- isc_mem_t *localmctx = NULL;
isc_mempool_t *mp1 = NULL, *mp2 = NULL;
unsigned int i, j;
int rval;
UNUSED(state);
- isc_mem_create(&localmctx);
-
- result = isc_mempool_create(localmctx, 24, &mp1);
+ result = isc_mempool_create(test_mctx, 24, &mp1);
assert_int_equal(result, ISC_R_SUCCESS);
- result = isc_mempool_create(localmctx, 31, &mp2);
+ result = isc_mempool_create(test_mctx, 31, &mp2);
assert_int_equal(result, ISC_R_SUCCESS);
isc_mempool_setfreemax(mp1, MP1_FREEMAX);
isc_mempool_destroy(&mp1);
isc_mempool_destroy(&mp2);
- isc_mem_destroy(&localmctx);
-
- isc_mem_create(&localmctx);
-
- result = isc_mempool_create(localmctx, 2, &mp1);
+ result = isc_mempool_create(test_mctx, 2, &mp1);
assert_int_equal(result, ISC_R_SUCCESS);
tmp = isc_mempool_get(mp1);
isc_mempool_put(mp1, tmp);
isc_mempool_destroy(&mp1);
-
- isc_mem_destroy(&localmctx);
-
}
/* test TotalUse calculation */
/* ISC_MEMFLAG_INTERNAL */
- before = isc_mem_total(mctx);
+ before = isc_mem_total(test_mctx);
for (i = 0; i < 100000; i++) {
void *ptr;
- ptr = isc_mem_allocate(mctx, 2048);
- isc_mem_free(mctx, ptr);
+ ptr = isc_mem_allocate(test_mctx, 2048);
+ isc_mem_free(test_mctx, ptr);
}
- after = isc_mem_total(mctx);
+ after = isc_mem_total(test_mctx);
diff = after - before;
/* 2048 +8 bytes extra for size_info */
for (int i = 0; i < ITERS; i++) {
for (int j = 0; j < NUM_ITEMS; j++) {
- items[j] = isc_mem_get(mctx, size);
+ items[j] = isc_mem_get(test_mctx, size);
}
for (int j = 0; j < NUM_ITEMS; j++) {
- isc_mem_put(mctx, items[j], size);
+ isc_mem_put(test_mctx, items[j], size);
}
}
isc_mutex_init(&mplock);
- result = isc_mempool_create(mctx, ITEM_SIZE, &mp);
+ result = isc_mempool_create(test_mctx, ITEM_SIZE, &mp);
assert_int_equal(result, ISC_R_SUCCESS);
isc_mempool_associatelock(mp, &mplock);
UNUSED(state);
- result = isc_pool_create(mctx, 8, poolfree, poolinit, taskmgr, &pool);
+ result = isc_pool_create(test_mctx, 8, poolfree, poolinit, taskmgr, &pool);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_pool_count(pool), 8);
UNUSED(state);
- result = isc_pool_create(mctx, 10, poolfree, poolinit, taskmgr, &pool1);
+ result = isc_pool_create(test_mctx, 10, poolfree, poolinit, taskmgr, &pool1);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_pool_count(pool1), 10);
UNUSED(state);
- result = isc_pool_create(mctx, 2, poolfree, poolinit, taskmgr, &pool);
+ result = isc_pool_create(test_mctx, 2, poolfree, poolinit, taskmgr, &pool);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_pool_count(pool), 2);
UNUSED(state);
- result = isc_radix_create(mctx, &radix, 32);
+ result = isc_radix_create(test_mctx, &radix, 32);
assert_int_equal(result, ISC_R_SUCCESS);
in_addr.s_addr = inet_addr("3.3.3.0");
#include <isc/result.h>
#include <isc/util.h>
+#include "isctest.h"
+
#define REPS 25000
typedef double (pvalue_func_t)(isc_mem_t *mctx,
ISC_NONCE_BYTES
} isc_random_func;
+static int
+_setup(void **state) {
+ isc_result_t result;
+
+ UNUSED(state);
+
+ result = isc_test_begin(NULL, true, 0);
+ assert_int_equal(result, ISC_R_SUCCESS);
+
+ return (0);
+}
+
+static int
+_teardown(void **state) {
+ UNUSED(state);
+
+ isc_test_end();
+
+ return (0);
+}
+
static double
igamc(double a, double x) {
double ans, ax, c, yc, r, t, y, z;
static void
random_test(pvalue_func_t *func, isc_random_func test_func) {
- isc_mem_t *mctx = NULL;
uint32_t m;
uint32_t j;
uint32_t histogram[11] = { 0 };
tables_init();
- isc_mem_create(&mctx);
-
m = 1000;
passed = 0;
break;
}
- p_value = (*func)(mctx, (uint16_t *)values, REPS * 2);
+ p_value = (*func)(test_mctx, (uint16_t *)values, REPS * 2);
if (p_value >= 0.01) {
passed++;
}
}
}
- return (cmocka_run_group_tests(tests, NULL, NULL));
+ return (cmocka_run_group_tests(tests, _setup, _teardown));
}
#else /* HAVE_CMOCKA */
completion_init(&completion);
- socketevent = isc_socket_socketevent(mctx, s1, ISC_SOCKEVENT_SENDDONE,
+ socketevent = isc_socket_socketevent(test_mctx, s1, ISC_SOCKEVENT_SENDDONE,
event_done, &completion);
assert_non_null(socketevent);
completion_init(&completion);
- socketevent = isc_socket_socketevent(mctx, s1, ISC_SOCKEVENT_SENDDONE,
+ socketevent = isc_socket_socketevent(test_mctx, s1, ISC_SOCKEVENT_SENDDONE,
event_done, &completion);
assert_non_null(socketevent);
completion_init(&completion);
- socketevent = isc_socket_socketevent(mctx, s1, ISC_SOCKEVENT_SENDDONE,
+ socketevent = isc_socket_socketevent(test_mctx, s1, ISC_SOCKEVENT_SENDDONE,
event_done, &completion);
assert_non_null(socketevent);
completion_init(&completion);
- socketevent = isc_socket_socketevent(mctx, s1, ISC_SOCKEVENT_SENDDONE,
+ socketevent = isc_socket_socketevent(test_mctx, s1, ISC_SOCKEVENT_SENDDONE,
event_done, &completion);
assert_non_null(socketevent);
UNUSED(arg);
assert_int_equal(type, 1);
- isc_mem_free(mctx, key);
- isc_mem_free(mctx, value.as_pointer);
+ isc_mem_free(test_mctx, key);
+ isc_mem_free(test_mctx, value.as_pointer);
}
/* test symbol table growth */
UNUSED(state);
- result = isc_symtab_create(mctx, 3, undefine, NULL, false, &st);
+ result = isc_symtab_create(test_mctx, 3, undefine, NULL, false, &st);
assert_int_equal(result, ISC_R_SUCCESS);
assert_non_null(st);
char str[16], *key;
snprintf(str, sizeof(str), "%04x", i);
- key = isc_mem_strdup(mctx, str);
+ key = isc_mem_strdup(test_mctx, str);
assert_non_null(key);
- value.as_pointer = isc_mem_strdup(mctx, str);
+ value.as_pointer = isc_mem_strdup(test_mctx, str);
assert_non_null(value.as_pointer);
result = isc_symtab_define(st, key, 1, value, policy);
assert_int_equal(result, ISC_R_SUCCESS);
char str[16], *key;
snprintf(str, sizeof(str), "%04x", i);
- key = isc_mem_strdup(mctx, str);
+ key = isc_mem_strdup(test_mctx, str);
assert_non_null(key);
- value.as_pointer = isc_mem_strdup(mctx, str);
+ value.as_pointer = isc_mem_strdup(test_mctx, str);
assert_non_null(value.as_pointer);
result = isc_symtab_define(st, key, 1, value, policy);
assert_int_equal(result, ISC_R_EXISTS);
assert_int_equal(result, ISC_R_SUCCESS);
/* First event */
- event = isc_event_allocate(mctx, task, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task, ISC_TASKEVENT_TEST,
set, &a, sizeof (isc_event_t));
assert_non_null(event);
assert_int_equal(atomic_load(&a), 0);
isc_task_send(task, &event);
- event = isc_event_allocate(mctx, task, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task, ISC_TASKEVENT_TEST,
set, &b, sizeof (isc_event_t));
assert_non_null(event);
assert_false(isc_task_privilege(task2));
/* First event: privileged */
- event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task1, ISC_TASKEVENT_TEST,
set, &a, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task1, &event);
/* Second event: not privileged */
- event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task2, ISC_TASKEVENT_TEST,
set, &b, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task2, &event);
/* Third event: privileged */
- event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task1, ISC_TASKEVENT_TEST,
set, &c, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task1, &event);
/* Fourth event: privileged */
- event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task1, ISC_TASKEVENT_TEST,
set, &d, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task1, &event);
/* Fifth event: not privileged */
- event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task2, ISC_TASKEVENT_TEST,
set, &e, sizeof (isc_event_t));
assert_non_null(event);
assert_false(isc_task_privilege(task2));
/* First event: privileged */
- event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task1, ISC_TASKEVENT_TEST,
set_and_drop, &a, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task1, &event);
/* Second event: not privileged */
- event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task2, ISC_TASKEVENT_TEST,
set_and_drop, &b, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task2, &event);
/* Third event: privileged */
- event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task1, ISC_TASKEVENT_TEST,
set_and_drop, &c, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task1, &event);
/* Fourth event: privileged */
- event = isc_event_allocate(mctx, task1, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task1, ISC_TASKEVENT_TEST,
set_and_drop, &d, sizeof (isc_event_t));
assert_non_null(event);
isc_task_send(task1, &event);
/* Fifth event: not privileged */
- event = isc_event_allocate(mctx, task2, ISC_TASKEVENT_TEST,
+ event = isc_event_allocate(test_mctx, task2, ISC_TASKEVENT_TEST,
set_and_drop, &e, sizeof (isc_event_t));
assert_non_null(event);
* structure (socket, timer, task, etc) but this is just a
* test program.
*/
- event = isc_event_allocate(mctx, (void *)1, 1, basic_cb,
+ event = isc_event_allocate(test_mctx, (void *)1, 1, basic_cb,
testarray[i], sizeof(*event));
assert_non_null(event);
isc_task_send(task1, &event);
isc_taskmgr_setexcltask(taskmgr, tasks[6]);
}
- v = isc_mem_get(mctx, sizeof *v);
+ v = isc_mem_get(test_mctx, sizeof *v);
assert_non_null(v);
*v = i;
- event = isc_event_allocate(mctx, NULL, 1, exclusive_cb,
+ event = isc_event_allocate(test_mctx, NULL, 1, exclusive_cb,
v, sizeof(*event));
assert_non_null(event);
static void
manytasks(void **state) {
+ isc_mem_t *mctx = NULL;
isc_result_t result;
isc_event_t *event = NULL;
uintptr_t ntasks = 10000;
/*
* This event causes the task to wait on cv.
*/
- event = isc_event_allocate(mctx, &senders[1], event_type, sd_event1,
+ event = isc_event_allocate(test_mctx, &senders[1], event_type, sd_event1,
NULL, sizeof(*event));
assert_non_null(event);
isc_task_send(task, &event);
* Now we fill up the task's event queue with some events.
*/
for (i = 0; i < 256; ++i) {
- event = isc_event_allocate(mctx, &senders[1], event_type,
+ event = isc_event_allocate(test_mctx, &senders[1], event_type,
sd_event2, NULL, sizeof(*event));
assert_non_null(event);
isc_task_send(task, &event);
/*
* This event causes the task to wait on cv.
*/
- event = isc_event_allocate(mctx, &senders[1], event_type, psd_event1,
+ event = isc_event_allocate(test_mctx, &senders[1], event_type, psd_event1,
NULL, sizeof(*event));
assert_non_null(event);
isc_task_send(task, &event);
/*
* Block the task on cv.
*/
- event = isc_event_allocate(mctx, (void *)1, 9999,
+ event = isc_event_allocate(test_mctx, (void *)1, 9999,
pg_event1, NULL, sizeof(*event));
assert_non_null(event);
for (type_cnt = 0; type_cnt < TYPECNT; ++type_cnt) {
for (tag_cnt = 0; tag_cnt < TAGCNT; ++tag_cnt) {
eventtab[event_cnt] =
- isc_event_allocate(mctx,
+ isc_event_allocate(test_mctx,
&senders[sender + sender_cnt],
(isc_eventtype_t)(type + type_cnt),
pg_event2, NULL, sizeof(*event));
/*
* Block the task on cv.
*/
- event1 = isc_event_allocate(mctx, (void *)1, (isc_eventtype_t)1,
+ event1 = isc_event_allocate(test_mctx, (void *)1, (isc_eventtype_t)1,
pge_event1, NULL, sizeof(*event1));
assert_non_null(event1);
isc_task_send(task, &event1);
- event2 = isc_event_allocate(mctx, (void *)1, (isc_eventtype_t)1,
+ event2 = isc_event_allocate(test_mctx, (void *)1, (isc_eventtype_t)1,
pge_event2, NULL, sizeof(*event2));
assert_non_null(event2);
UNUSED(state);
- result = isc_taskpool_create(taskmgr, mctx, 8, 2, &pool);
+ result = isc_taskpool_create(taskmgr, test_mctx, 8, 2, &pool);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_taskpool_size(pool), 8);
UNUSED(state);
- result = isc_taskpool_create(taskmgr, mctx, 10, 2, &pool1);
+ result = isc_taskpool_create(taskmgr, test_mctx, 10, 2, &pool1);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_taskpool_size(pool1), 10);
UNUSED(state);
- result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool);
+ result = isc_taskpool_create(taskmgr, test_mctx, 2, 2, &pool);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_taskpool_size(pool), 2);
UNUSED(state);
- result = isc_taskpool_create(taskmgr, mctx, 2, 2, &pool);
+ result = isc_taskpool_create(taskmgr, test_mctx, 2, 2, &pool);
assert_int_equal(result, ISC_R_SUCCESS);
assert_int_equal(isc_taskpool_size(pool), 2);
LOCK(&mx);
- event = isc_event_allocate(mctx, (void *)1 , (isc_eventtype_t)1,
+ event = isc_event_allocate(test_mctx, (void *)1 , (isc_eventtype_t)1,
start_event, NULL, sizeof(*event));
assert_non_null(event);
isc_task_send(task1, &event);