Replace CONFIG_USERMAIN_STACKSIZE with other name in tc
authorjunmin kim <junmindd.kim@samsung.com>
Thu, 29 Jun 2017 05:53:18 +0000 (22:53 -0700)
committerjunmin kim <junmindd.kim@samsung.com>
Fri, 30 Jun 2017 04:14:19 +0000 (21:14 -0700)
CONFIG_USERMAIN_STACKSIZE should be used for main task stacksize

apps/examples/testcase/le_tc/kernel/tc_group.c
apps/examples/testcase/le_tc/kernel/tc_libc_spawn.c
apps/examples/testcase/le_tc/kernel/tc_sched.c

index f5bd651..27aff98 100644 (file)
@@ -29,6 +29,8 @@
 #include "../../../../../os/kernel/group/group.h"
 #include "tc_internal.h"
 
+#define TASK_STACKSIZE 2048
+
 static int group_exitchild_func(int argc, char *argv[])
 {
        task_delete(0);
@@ -138,7 +140,7 @@ static void tc_group_group_exit_child(void)
        group = st_tcb->group;
        TC_ASSERT_NOT_NULL("sched_self", group);
 
-       child_pid = task_create("group", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, group_exitchild_func, (char *const *)NULL);
+       child_pid = task_create("group", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, group_exitchild_func, (char *const *)NULL);
 
        child = group_findchild(group, child_pid);
        TC_ASSERT_NOT_NULL("group_findchild", child);
index 83b5a26..c22817e 100644 (file)
@@ -40,6 +40,7 @@
 #define SEC_10000 10000
 #define MIN_SIGNO 0
 #define FILEPATH "/dev/smart1"
+#define SPAWN_STACKSIZE 2048
 
 /**
 * @fn                   :function_name_spawn
@@ -197,7 +198,7 @@ static void tc_libc_spawn_task_spawnattr_setgetstacksize(void)
        ret_chk = posix_spawnattr_init(&st_attr);
        TC_ASSERT_EQ("posix_spawnattr_init", ret_chk, OK);
 
-       ret_chk = task_spawnattr_setstacksize(&st_attr, CONFIG_USERMAIN_STACKSIZE);
+       ret_chk = task_spawnattr_setstacksize(&st_attr, SPAWN_STACKSIZE);
        TC_ASSERT_EQ("task_spawnattr_setstacksize", ret_chk, OK);
 
        ret_chk = task_spawn(&pid, "spawn_stacksize", function_name_spawn, NULL, &st_attr, (char *const *)NULL, (char *const *)NULL);
@@ -206,7 +207,7 @@ static void tc_libc_spawn_task_spawnattr_setgetstacksize(void)
 
        ret_chk = task_spawnattr_getstacksize(&st_attr, &stacksize);
        TC_ASSERT_EQ("task_spawnattr_getstacksize", ret_chk, OK);
-       TC_ASSERT_EQ("task_spawnattr_getstacksize", stacksize, CONFIG_USERMAIN_STACKSIZE);
+       TC_ASSERT_EQ("task_spawnattr_getstacksize", stacksize, SPAWN_STACKSIZE);
 
        TC_SUCCESS_RESULT();
 }
index 5a2df69..c85ccab 100644 (file)
@@ -39,6 +39,7 @@
 #define ARRLEN          2
 #define VAL_3           3
 #define VAL_5           5
+#define TASK_STACKSIZE 2048
 
 pthread_t thread1, thread2;
 
@@ -237,10 +238,10 @@ static void tc_sched_wait(void)
        int status;
 
        /* creating new process */
-       child1_pid = task_create("sched1", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, function_wait, (char * const *)NULL);
+       child1_pid = task_create("sched1", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, function_wait, (char * const *)NULL);
        TC_ASSERT_GT("task_create", child1_pid, 0);
 
-       child2_pid = task_create("sched2", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, function_waitlong, (char * const *)NULL);
+       child2_pid = task_create("sched2", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, function_waitlong, (char * const *)NULL);
        TC_ASSERT_GT("task_create", child2_pid, 0);
 
        /* child which exits first is handled by wait, here child1_pid exits earlier. */
@@ -273,7 +274,7 @@ static void tc_sched_waitid(void)
        pid_t child_pid;
        siginfo_t info;
 
-       child_pid = task_create("tc_waitid", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, function_waitid, (char * const *)NULL);
+       child_pid = task_create("tc_waitid", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, function_waitid, (char * const *)NULL);
        TC_ASSERT_GT("task_create", child_pid, 0);
 
        ret_chk = waitid(P_PID, child_pid, &info, WEXITED);
@@ -302,7 +303,7 @@ static void tc_sched_waitpid(void)
        pid_t child_pid;
        int *status = (int *)malloc(sizeof(int));
 
-       child_pid = task_create("tc_waitpid", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, function_wait, (char * const *)NULL);
+       child_pid = task_create("tc_waitpid", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, function_wait, (char * const *)NULL);
        TC_ASSERT_GT("task_create", child_pid, 0);
 
        ret_chk = waitpid(child_pid, status, 0);
@@ -329,7 +330,7 @@ static void tc_sched_sched_gettcb(void)
        pid_t pid;
        int stat_loc;
 
-       pid = task_create("tc_gettcb", SCHED_PRIORITY_DEFAULT, CONFIG_USERMAIN_STACKSIZE, function_wait, (char * const *)NULL);
+       pid = task_create("tc_gettcb", SCHED_PRIORITY_DEFAULT, TASK_STACKSIZE, function_wait, (char * const *)NULL);
        TC_ASSERT_NEQ("task_create", pid, ERROR);
 
        tcb = sched_gettcb(pid);