#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);
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);
#define SEC_10000 10000
#define MIN_SIGNO 0
#define FILEPATH "/dev/smart1"
+#define SPAWN_STACKSIZE 2048
/**
* @fn :function_name_spawn
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);
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();
}
#define ARRLEN 2
#define VAL_3 3
#define VAL_5 5
+#define TASK_STACKSIZE 2048
pthread_t thread1, thread2;
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. */
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);
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);
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);