This patch fails to apply to current tip. Looks like struct CU_TestInfo schd_tests[] has been renamed to test_odp_schedule[]
Bill On Mon, Mar 23, 2015 at 9:42 AM, Petri Savolainen < [email protected]> wrote: > The test creates one queue of each schedule sync type and > destroys those. > > Signed-off-by: Petri Savolainen <[email protected]> > --- > test/validation/odp_schedule.c | 64 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 64 insertions(+) > > diff --git a/test/validation/odp_schedule.c > b/test/validation/odp_schedule.c > index b86f997..8cea798 100644 > --- a/test/validation/odp_schedule.c > +++ b/test/validation/odp_schedule.c > @@ -33,6 +33,7 @@ > #define DISABLE_EXCL_ATOMIC 0 > #define ENABLE_EXCL_ATOMIC 1 > > +#define MAGIC 0xdeadbeef > > /* Test global variables */ > typedef struct { > @@ -80,6 +81,68 @@ static void test_schedule_num_prio(void) > CU_ASSERT(prio == odp_schedule_num_prio()); > } > > +static void test_schedule_queue_destroy(void) > +{ > + odp_pool_t p; > + odp_pool_param_t params; > + odp_queue_param_t qp; > + odp_queue_t queue, from; > + odp_buffer_t buf; > + odp_event_t ev; > + uint32_t *u32; > + int i; > + odp_schedule_sync_t sync[] = {ODP_SCHED_SYNC_NONE, > + ODP_SCHED_SYNC_ATOMIC, > + ODP_SCHED_SYNC_ORDERED}; > + > + params.buf.size = 100; > + params.buf.align = 0; > + params.buf.num = 1; > + params.type = ODP_POOL_BUFFER; > + > + p = odp_pool_create("sched_destroy_pool", ODP_SHM_NULL, ¶ms); > + > + CU_ASSERT_FATAL(p != ODP_POOL_INVALID); > + > + for (i = 0; i < 3; i++) { > + qp.sched.prio = ODP_SCHED_PRIO_DEFAULT; > + qp.sched.group = ODP_SCHED_GROUP_DEFAULT; > + qp.sched.sync = sync[i]; > + > + queue = odp_queue_create("sched_destroy_queue", > + ODP_QUEUE_TYPE_SCHED, &qp); > + > + CU_ASSERT_FATAL(queue != ODP_QUEUE_INVALID); > + > + buf = odp_buffer_alloc(p); > + > + CU_ASSERT_FATAL(buf != ODP_BUFFER_INVALID); > + > + u32 = odp_buffer_addr(buf); > + u32[0] = MAGIC; > + > + ev = odp_buffer_to_event(buf); > + CU_ASSERT(odp_queue_enq(queue, ev) == 0); > + > + ev = odp_schedule(&from, ODP_SCHED_WAIT); > + > + CU_ASSERT_FATAL(ev != ODP_EVENT_INVALID); > + > + CU_ASSERT_FATAL(from == queue); > + > + buf = odp_buffer_from_event(ev); > + u32 = odp_buffer_addr(buf); > + > + CU_ASSERT_FATAL(u32[0] == MAGIC); > + > + odp_buffer_free(buf); > + > + CU_ASSERT_FATAL(odp_queue_destroy(queue) == 0); > + } > + > + CU_ASSERT_FATAL(odp_pool_destroy(p) == 0); > +} > + > static void *schedule_common_(void *arg) > { > thread_args_t *args = (thread_args_t *)arg; > @@ -678,6 +741,7 @@ static int schd_suite_term(void) > struct CU_TestInfo schd_tests[] = { > {"schedule_wait_time", test_schedule_wait_time}, > {"schedule_num_prio", test_schedule_num_prio}, > + {"schedule_queue_destroy", test_schedule_queue_destroy}, > {"schedule_1q_1t_n", test_schedule_1q_1t_n}, > {"schedule_1q_1t_a", test_schedule_1q_1t_a}, > {"schedule_1q_1t_o", test_schedule_1q_1t_o}, > -- > 2.3.3 > > > _______________________________________________ > lng-odp mailing list > [email protected] > http://lists.linaro.org/mailman/listinfo/lng-odp >
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
