Esempio n. 1
0
	odp_pool_t pool;

	if (destroy_queues() != 0) {
		fprintf(stderr, "error: failed to destroy queues\n");
		return -1;
	}

	pool = odp_pool_lookup(MSG_POOL_NAME);
	if (odp_pool_destroy(pool) != 0)
		fprintf(stderr, "error: failed to destroy pool\n");

	return 0;
}

odp_testinfo_t scheduler_suite[] = {
	ODP_TEST_INFO(scheduler_test_wait_time),
	ODP_TEST_INFO(scheduler_test_num_prio),
	ODP_TEST_INFO(scheduler_test_queue_destroy),
	ODP_TEST_INFO(scheduler_test_groups),
	ODP_TEST_INFO(scheduler_test_pause_resume),
	ODP_TEST_INFO(scheduler_test_parallel),
	ODP_TEST_INFO(scheduler_test_atomic),
	ODP_TEST_INFO(scheduler_test_ordered),
	ODP_TEST_INFO(scheduler_test_chaos),
	ODP_TEST_INFO(scheduler_test_1q_1t_n),
	ODP_TEST_INFO(scheduler_test_1q_1t_a),
	ODP_TEST_INFO(scheduler_test_1q_1t_o),
	ODP_TEST_INFO(scheduler_test_mq_1t_n),
	ODP_TEST_INFO(scheduler_test_mq_1t_a),
	ODP_TEST_INFO(scheduler_test_mq_1t_o),
	ODP_TEST_INFO(scheduler_test_mq_1t_prio_n),
Esempio n. 2
0
File: hash.c Progetto: nmorey/odp
	CU_ASSERT(ret == 0xfa745634);

	test_value = 0x87654321;
	ret = odp_hash_crc32c(&test_value, 4, 0);

	CU_ASSERT(ret == 0xaca37da7);

	uint32_t test_values[] = {0x12345678, 0x87654321};

	ret = odp_hash_crc32c(test_values, 8, 0);

	CU_ASSERT(ret == 0xe6e910b0);
}

odp_testinfo_t hash_suite[] = {
	ODP_TEST_INFO(hash_test_crc32c),
	ODP_TEST_INFO_NULL,
};

odp_suiteinfo_t hash_suites[] = {
	{"Hash", NULL, NULL, hash_suite},
	ODP_SUITE_INFO_NULL
};

int hash_main(int argc, char *argv[])
{
	int ret;

	/* parse common options: */
	if (odp_cunit_parse_options(argc, argv))
		return -1;
Esempio n. 3
0
File: queue.c Progetto: nmorey/odp
	CU_ASSERT(ctx == q_order_ctx);
	CU_ASSERT(info.param.context == odp_queue_context(q_order));
	CU_ASSERT(info.param.sched.prio == odp_queue_sched_prio(q_order));
	CU_ASSERT(info.param.sched.sync == odp_queue_sched_type(q_order));
	CU_ASSERT(info.param.sched.group == odp_queue_sched_group(q_order));
	ret = odp_queue_lock_count(q_order);
	CU_ASSERT(ret >= 0);
	lock_count = (unsigned)ret;
	CU_ASSERT(info.param.sched.lock_count == lock_count);

	CU_ASSERT(odp_queue_destroy(q_plain) == 0);
	CU_ASSERT(odp_queue_destroy(q_order) == 0);
}

odp_testinfo_t queue_suite[] = {
	ODP_TEST_INFO(queue_test_capa),
	ODP_TEST_INFO(queue_test_mode),
	ODP_TEST_INFO(queue_test_param),
	ODP_TEST_INFO(queue_test_info),
	ODP_TEST_INFO_NULL,
};

odp_suiteinfo_t queue_suites[] = {
	{"Queue", queue_suite_init, queue_suite_term, queue_suite},
	ODP_SUITE_INFO_NULL,
};

int queue_main(int argc, char *argv[])
{
	int ret;
Esempio n. 4
0
	CU_ASSERT(ctx == q_order_ctx);
	CU_ASSERT(info.param.context == odp_queue_context(q_order));
	CU_ASSERT(info.param.sched.prio == odp_queue_sched_prio(q_order));
	CU_ASSERT(info.param.sched.sync == odp_queue_sched_type(q_order));
	CU_ASSERT(info.param.sched.group == odp_queue_sched_group(q_order));
	ret = odp_queue_lock_count(q_order);
	CU_ASSERT(ret >= 0);
	lock_count = (unsigned) ret;
	CU_ASSERT(info.param.sched.lock_count == lock_count);

	CU_ASSERT(odp_queue_destroy(q_poll) == 0);
	CU_ASSERT(odp_queue_destroy(q_order) == 0);
}

odp_testinfo_t queue_suite[] = {
	ODP_TEST_INFO(queue_test_sunnydays),
	ODP_TEST_INFO(queue_test_info),
	ODP_TEST_INFO_NULL,
};

odp_suiteinfo_t queue_suites[] = {
	{"Queue", queue_suite_init, queue_suite_term, queue_suite},
	ODP_SUITE_INFO_NULL,
};

int queue_main(void)
{
	int ret = odp_cunit_register(queue_suites);

	if (ret == 0)
		ret = odp_cunit_run();
Esempio n. 5
0
	for (i = 0; i < sizeof(data); i++) {
		uint8_t tmp;

		CU_ASSERT(odp_memcmp(data, equal, i + 1) == 0);
		tmp      = equal[i];
		equal[i] = 88;
		CU_ASSERT(odp_memcmp(data, equal, i + 1) < 0);
		equal[i] = 0;
		CU_ASSERT(odp_memcmp(data, equal, i + 1) > 0);
		equal[i] = tmp;
	}
}

odp_testinfo_t std_clib_suite[] = {
	ODP_TEST_INFO(std_clib_test_memcpy),
	ODP_TEST_INFO(std_clib_test_memset),
	ODP_TEST_INFO(std_clib_test_memcmp),
	ODP_TEST_INFO_NULL,
};

odp_suiteinfo_t std_clib_suites[] = {
	{"Std C library", NULL, NULL, std_clib_suite},
	ODP_SUITE_INFO_NULL
};

int std_clib_main(void)
{
	int ret = odp_cunit_register(std_clib_suites);

	if (ret == 0)
Esempio n. 6
0
				pool_name);
			ret = -1;
		}
	}

	if (odp_pool_destroy(default_pkt_pool) != 0) {
		fprintf(stderr, "error: failed to destroy default pool\n");
		ret = -1;
	}
	default_pkt_pool = ODP_POOL_INVALID;

	return ret;
}

odp_testinfo_t pktio_suite_unsegmented[] = {
	ODP_TEST_INFO(pktio_test_open),
	ODP_TEST_INFO(pktio_test_lookup),
	ODP_TEST_INFO(pktio_test_inq),
	/* ODP_TEST_INFO(pktio_test_poll_queue), */
	/* ODP_TEST_INFO(pktio_test_poll_multi), */
	ODP_TEST_INFO(pktio_test_sched_queue),
	ODP_TEST_INFO(pktio_test_sched_multi),
	ODP_TEST_INFO(pktio_test_recv),
	ODP_TEST_INFO(pktio_test_recv_multi),
	ODP_TEST_INFO(pktio_test_jumbo),
	ODP_TEST_INFO_CONDITIONAL(pktio_test_send_failure,
				  pktio_check_send_failure),
	ODP_TEST_INFO(pktio_test_mtu),
	ODP_TEST_INFO(pktio_test_promisc),
	ODP_TEST_INFO(pktio_test_mac),
	ODP_TEST_INFO(pktio_test_inq_remdef),
	retval = odp_pmr_match_set_destroy(ODP_PMR_SET_INVAL);
	CU_ASSERT(retval < 0);

	for (i = 0; i < PMR_SET_NUM; i++) {
		pmr_terms[i].term = ODP_PMR_TCP_DPORT;
		pmr_terms[i].val = &val;
		pmr_terms[i].mask = &mask;
		pmr_terms[i].val_sz = sizeof(val);
	}

	retval = odp_pmr_match_set_create(PMR_SET_NUM, pmr_terms, &pmr_set);
	CU_ASSERT(retval > 0);

	retval = odp_pmr_match_set_destroy(pmr_set);
	CU_ASSERT(retval == 0);
}

odp_testinfo_t classification_suite_basic[] = {
	ODP_TEST_INFO(classification_test_create_cos),
	ODP_TEST_INFO(classification_test_destroy_cos),
	ODP_TEST_INFO(classification_test_create_pmr_match),
	ODP_TEST_INFO(classification_test_destroy_pmr),
	ODP_TEST_INFO(classification_test_cos_set_queue),
	ODP_TEST_INFO(classification_test_cos_set_drop),
	ODP_TEST_INFO(classification_test_cos_set_pool),
	ODP_TEST_INFO(classification_test_pmr_match_set_create),
	ODP_TEST_INFO(classification_test_pmr_match_set_destroy),
	ODP_TEST_INFO_NULL,
};
Esempio n. 8
0
	odp_pool_t pool;

	if (destroy_queues() != 0) {
		fprintf(stderr, "error: failed to destroy queues\n");
		return -1;
	}

	pool = odp_pool_lookup(MSG_POOL_NAME);
	if (odp_pool_destroy(pool) != 0)
		fprintf(stderr, "error: failed to destroy pool\n");

	return 0;
}

odp_testinfo_t scheduler_suite[] = {
	ODP_TEST_INFO(scheduler_test_wait_time),
	ODP_TEST_INFO(scheduler_test_num_prio),
	ODP_TEST_INFO(scheduler_test_queue_destroy),
	ODP_TEST_INFO(scheduler_test_groups),
	/* ODP_TEST_INFO(scheduler_test_chaos), */
	ODP_TEST_INFO(scheduler_test_1q_1t_n),
	ODP_TEST_INFO(scheduler_test_1q_1t_a),
	/* ODP_TEST_INFO(scheduler_test_1q_1t_o), */
	ODP_TEST_INFO(scheduler_test_mq_1t_n),
	ODP_TEST_INFO(scheduler_test_mq_1t_a),
	/* ODP_TEST_INFO(scheduler_test_mq_1t_o), */
	ODP_TEST_INFO(scheduler_test_mq_1t_prio_n),
	ODP_TEST_INFO(scheduler_test_mq_1t_prio_a),
	/* ODP_TEST_INFO(scheduler_test_mq_1t_prio_o), */
	ODP_TEST_INFO(scheduler_test_mq_mt_prio_n),
	ODP_TEST_INFO(scheduler_test_mq_mt_prio_a),