Skip to content

Commit 82debed

Browse files
zhkagGuozhanxin
authored andcommitted
[utest] 更改线程栈的大小,避免栈异常
1 parent 29a5082 commit 82debed

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

examples/utest/testcases/kernel/atomic_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#define THREAD_PRIORITY 25
1818
#define THREAD_TIMESLICE 1
19-
#define THREAD_STACKSIZE 1024
19+
#define THREAD_STACKSIZE UTEST_THR_STACK_SIZE
2020

2121
/* convenience macro - return either 64-bit or 32-bit value */
2222
#define ATOMIC_WORD(val_if_64, val_if_32) \

examples/utest/testcases/kernel/event_tc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ static rt_event_t dynamic_event = RT_NULL;
2121
static rt_uint32_t dynamic_event_recv_thread_finish = 0, dynamic_event_send_thread_finish = 0;
2222

2323
rt_align(RT_ALIGN_SIZE)
24-
static char thread3_stack[1024];
24+
static char thread3_stack[UTEST_THR_STACK_SIZE];
2525
static struct rt_thread thread3;
2626

2727
rt_align(RT_ALIGN_SIZE)
28-
static char thread4_stack[1024];
28+
static char thread4_stack[UTEST_THR_STACK_SIZE];
2929
static struct rt_thread thread4;
3030
#endif /* RT_USING_HEAP */
3131

3232
static rt_uint32_t recv_event_times1 = 0, recv_event_times2 = 0;
3333
static rt_uint32_t static_event_recv_thread_finish = 0, static_event_send_thread_finish = 0;
3434

3535
rt_align(RT_ALIGN_SIZE)
36-
static char thread1_stack[1024];
36+
static char thread1_stack[UTEST_THR_STACK_SIZE];
3737
static struct rt_thread thread1;
3838

3939
rt_align(RT_ALIGN_SIZE)
40-
static char thread2_stack[1024];
40+
static char thread2_stack[UTEST_THR_STACK_SIZE];
4141
static struct rt_thread thread2;
4242

4343
#define THREAD_PRIORITY 9

examples/utest/testcases/kernel/mailbox_tc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ static uint8_t static_mb_recv_thread_finish, static_mb_send_thread_finish;
2121
static uint8_t dynamic_mb_recv_thread_finish, dynamic_mb_send_thread_finish;
2222

2323
rt_align(RT_ALIGN_SIZE)
24-
static char thread1_stack[1024];
24+
static char thread1_stack[UTEST_THR_STACK_SIZE];
2525
static struct rt_thread thread1;
2626

2727
rt_align(RT_ALIGN_SIZE)
28-
static char thread2_stack[1024];
28+
static char thread2_stack[UTEST_THR_STACK_SIZE];
2929
static struct rt_thread thread2;
3030

3131
#define THREAD_PRIORITY 9
@@ -315,7 +315,7 @@ static void test_dynamic_mailbox_send_recv(void)
315315
mb_recv = rt_thread_create("mb_recv_thread",
316316
thread3_recv_dynamic_mb,
317317
RT_NULL,
318-
1024,
318+
UTEST_THR_STACK_SIZE,
319319
THREAD_PRIORITY - 1,
320320
THREAD_TIMESLICE);
321321
if (mb_recv == RT_NULL)
@@ -327,7 +327,7 @@ static void test_dynamic_mailbox_send_recv(void)
327327
mb_send = rt_thread_create("mb_send_thread",
328328
thread4_send_dynamic_mb,
329329
RT_NULL,
330-
1024,
330+
UTEST_THR_STACK_SIZE,
331331
THREAD_PRIORITY - 1,
332332
THREAD_TIMESLICE);
333333
if (mb_send == RT_NULL)

examples/utest/testcases/kernel/messagequeue_tc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ static rt_uint8_t mq_buf[RT_MQ_BUF_SIZE(MSG_SIZE, MAX_MSGS)];
1919

2020
static struct rt_thread mq_send_thread;
2121
static struct rt_thread mq_recv_thread;
22-
static rt_uint8_t mq_send_stack[1024];
23-
static rt_uint8_t mq_recv_stack[1024];
22+
static rt_uint8_t mq_send_stack[UTEST_THR_STACK_SIZE];
23+
static rt_uint8_t mq_recv_stack[UTEST_THR_STACK_SIZE];
2424

2525
static struct rt_event finish_e;
2626
#define MQSEND_FINISH 0x01

examples/utest/testcases/kernel/mutex_tc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static void test_static_pri_reverse(void)
294294
tid1 = rt_thread_create("thread1",
295295
static_thread1_entry,
296296
&static_mutex,
297-
1024,
297+
UTEST_THR_STACK_SIZE,
298298
10 - 1,
299299
10);
300300
if (tid1 != RT_NULL)
@@ -304,7 +304,7 @@ static void test_static_pri_reverse(void)
304304
tid2 = rt_thread_create("thread2",
305305
static_thread2_entry,
306306
&static_mutex,
307-
1024,
307+
UTEST_THR_STACK_SIZE,
308308
10,
309309
10);
310310
if (tid2 != RT_NULL)
@@ -314,7 +314,7 @@ static void test_static_pri_reverse(void)
314314
tid3 = rt_thread_create("thread3",
315315
static_thread3_entry,
316316
&static_mutex,
317-
1024,
317+
UTEST_THR_STACK_SIZE,
318318
10 + 1,
319319
10);
320320
if (tid3 != RT_NULL)
@@ -603,7 +603,7 @@ static void test_dynamic_pri_reverse(void)
603603
tid1 = rt_thread_create("thread1",
604604
dynamic_thread1_entry,
605605
dynamic_mutex,
606-
1024,
606+
UTEST_THR_STACK_SIZE,
607607
10 - 1,
608608
10);
609609
if (tid1 != RT_NULL)
@@ -613,7 +613,7 @@ static void test_dynamic_pri_reverse(void)
613613
tid2 = rt_thread_create("thread2",
614614
dynamic_thread2_entry,
615615
dynamic_mutex,
616-
1024,
616+
UTEST_THR_STACK_SIZE,
617617
10,
618618
10);
619619
if (tid2 != RT_NULL)
@@ -623,7 +623,7 @@ static void test_dynamic_pri_reverse(void)
623623
tid3 = rt_thread_create("thread3",
624624
dynamic_thread3_entry,
625625
dynamic_mutex,
626-
1024,
626+
UTEST_THR_STACK_SIZE,
627627
10 + 1,
628628
10);
629629
if (tid3 != RT_NULL)

examples/utest/testcases/kernel/thread_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define THREAD_TIMESLICE 10
1818

1919
rt_align(RT_ALIGN_SIZE)
20-
static char thread2_stack[1024];
20+
static char thread2_stack[UTEST_THR_STACK_SIZE];
2121
static struct rt_thread thread2;
2222
#ifdef RT_USING_HEAP
2323
static rt_thread_t tid1 = RT_NULL;

0 commit comments

Comments
 (0)