From: EunBong Song Date: Mon, 10 Apr 2017 10:01:09 +0000 (+0900) Subject: testcase: fix up tc_roundrobin.c problem X-Git-Tag: 1.1_Public_Release~614^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7448c30b0084da23c19fa05aa4877e3edf3addb7;p=rtos%2Ftinyara.git testcase: fix up tc_roundrobin.c problem tc_roundrobin try to create 15 pthread. In case of CONFIG_MAX_TASKS is 16 or smaller than 16. This should fail. This patch fix up this problem. Change-Id: I0e773d275db29a262a0acf4cd7f66c1abdf3e734 Signed-off-by: EunBong Song --- diff --git a/apps/examples/testcase/le_tc/kernel/tc_roundrobin.c b/apps/examples/testcase/le_tc/kernel/tc_roundrobin.c index f771965..0eb55d1 100644 --- a/apps/examples/testcase/le_tc/kernel/tc_roundrobin.c +++ b/apps/examples/testcase/le_tc/kernel/tc_roundrobin.c @@ -36,7 +36,11 @@ #define LOOP 10 #define LOG_SIZE 400 #define TESTCASE 3 +#if CONFIG_MAX_TASKS > 16 #define NTHREAD 5 +#else +#define NTHREAD 3 +#endif #define MAX_TASKS_MASK (CONFIG_MAX_TASKS-1) #define PIDHASH(pid) ((pid) & MAX_TASKS_MASK) /**************************************************************************** @@ -47,7 +51,11 @@ int log_timeslice[LOG_SIZE]; volatile int logidx; int start, created; int pid_prio[CONFIG_MAX_TASKS]; +#if CONFIG_MAX_TASKS > 16 int priority[TESTCASE][NTHREAD] = { {90, 100, 100, 100, 110}, {110, 120, 120, 120, 130}, {70, 80, 80, 80, 90} }; +#else +int priority[TESTCASE][NTHREAD] = { {90, 100, 110}, {110, 120, 130}, {70, 80, 90} }; +#endif pthread_attr_t attr; struct sched_param param;