testcase: fix up tc_roundrobin.c problem
authorEunBong Song <eunb.song@samsung.com>
Mon, 10 Apr 2017 10:01:09 +0000 (19:01 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Tue, 18 Apr 2017 03:02:13 +0000 (12:02 +0900)
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 <eunb.song@samsung.com>
apps/examples/testcase/le_tc/kernel/tc_roundrobin.c

index f771965..0eb55d1 100644 (file)
 #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;