tests: adapted to renamed THREAD_FLAGS

This commit is contained in:
Hauke Petersen 2015-12-02 12:00:37 +01:00
parent 41979b64cd
commit cc23481d55
23 changed files with 45 additions and 38 deletions

View File

@ -147,7 +147,7 @@ static int ip_send(char *addr_str, char *port_str, char *data, unsigned int num,
static int ip_start_server(char *port_str) static int ip_start_server(char *port_str)
{ {
if (thread_create(server_stack, sizeof(server_stack), THREAD_PRIORITY_MAIN - 1, if (thread_create(server_stack, sizeof(server_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, _server_thread, port_str, "IP server") <= KERNEL_PID_UNDEF) { THREAD_CREATE_STACKTEST, _server_thread, port_str, "IP server") <= KERNEL_PID_UNDEF) {
return 1; return 1;
} }
return 0; return 0;

View File

@ -80,7 +80,7 @@ int main(void)
#else #else
thread_create( thread_create(
pir_handler_stack, sizeof(pir_handler_stack), THREAD_PRIORITY_MAIN - 1, pir_handler_stack, sizeof(pir_handler_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
pir_handler, NULL, "pir_handler"); pir_handler, NULL, "pir_handler");
#endif #endif
return 0; return 0;

View File

@ -54,7 +54,7 @@ int main(void)
busy = 1; busy = 1;
k = 23; k = 23;
thread_create(busy_stack, sizeof(busy_stack), thread_create(busy_stack, sizeof(busy_stack),
THREAD_PRIORITY_MAIN + 1, CREATE_WOUT_YIELD, THREAD_PRIORITY_MAIN + 1, THREAD_CREATE_WOUT_YIELD,
busy_thread, NULL, "busy_thread"); busy_thread, NULL, "busy_thread");
puts("busy_thread created"); puts("busy_thread created");

View File

@ -49,7 +49,7 @@ int main(void)
kernel_pid_t second_pid = thread_create(stack, kernel_pid_t second_pid = thread_create(stack,
sizeof(stack), sizeof(stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
second_thread, second_thread,
NULL, NULL,
"second_thread"); "second_thread");

View File

@ -100,10 +100,12 @@ int main(void)
} }
thread_create(stacks[0], sizeof (stacks[0]), thread_create(stacks[0], sizeof (stacks[0]),
THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
run_middle, NULL, "middle"); run_middle, NULL, "middle");
thread_create(stacks[1], sizeof (stacks[1]), thread_create(stacks[1], sizeof (stacks[1]),
THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
run_end, NULL, "end"); run_end, NULL, "end");
unsigned total = 0; unsigned total = 0;

View File

@ -77,7 +77,8 @@ static void test1(void)
kernel_pid_t pid = thread_create(test1_thread_stack, kernel_pid_t pid = thread_create(test1_thread_stack,
sizeof(test1_thread_stack), sizeof(test1_thread_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST | CREATE_WOUT_YIELD, THREAD_CREATE_STACKTEST |
THREAD_CREATE_WOUT_YIELD,
test1_second_thread, test1_second_thread,
NULL, NULL,
"second"); "second");
@ -154,7 +155,7 @@ void test2(void)
kernel_pid_t pid = thread_create(test2_thread_stack[i], kernel_pid_t pid = thread_create(test2_thread_stack[i],
sizeof(test2_thread_stack[i]), sizeof(test2_thread_stack[i]),
priority, priority,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
priority_sema_thread, priority_sema_thread,
names[i], names[i],
names[i]); names[i]);
@ -211,14 +212,14 @@ void test3(void)
} }
puts("first: create thread 1"); puts("first: create thread 1");
if (thread_create(test2_thread_stack[0], sizeof(test2_thread_stack[0]), if (thread_create(test2_thread_stack[0], sizeof(test2_thread_stack[0]),
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST, THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
test3_one_two_thread, NULL, "thread 1") < 0) { test3_one_two_thread, NULL, "thread 1") < 0) {
puts("first: thread create FAILED"); puts("first: thread create FAILED");
return; return;
} }
puts("first: create thread 2"); puts("first: create thread 2");
if (thread_create(test2_thread_stack[1], sizeof(test2_thread_stack[1]), if (thread_create(test2_thread_stack[1], sizeof(test2_thread_stack[1]),
THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST, THREAD_PRIORITY_MAIN - 1, THREAD_CREATE_STACKTEST,
test3_two_one_thread, NULL, "thread 2") < 0) { test3_two_one_thread, NULL, "thread 2") < 0) {
puts("first: thread create FAILED"); puts("first: thread create FAILED");
return; return;

View File

@ -58,7 +58,7 @@ int main(void)
pthread_cond_init(&cv, NULL); pthread_cond_init(&cv, NULL);
kernel_pid_t pid = thread_create(stack,sizeof(stack), THREAD_PRIORITY_MAIN - 1, kernel_pid_t pid = thread_create(stack,sizeof(stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
second_thread, NULL, "second_thread"); second_thread, NULL, "second_thread");
while (1) { while (1) {

View File

@ -128,7 +128,7 @@ int main(void)
} }
thread_create(stacks[i], sizeof(stacks[i]), thread_create(stacks[i], sizeof(stacks[i]),
prio, CREATE_WOUT_YIELD | CREATE_STACKTEST, prio, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
fun, NULL, name); fun, NULL, name);
} }

View File

@ -34,7 +34,7 @@ int main(void)
puts("----------------------------------------------------------------"); puts("----------------------------------------------------------------");
thread_create(snd_thread_stack, sizeof(snd_thread_stack), THREAD_PRIORITY_MAIN, thread_create(snd_thread_stack, sizeof(snd_thread_stack), THREAD_PRIORITY_MAIN,
CREATE_WOUT_YIELD, snd_thread, NULL, "snd"); THREAD_CREATE_WOUT_YIELD, snd_thread, NULL, "snd");
puts("yield 1"); puts("yield 1");
thread_yield(); thread_yield();

View File

@ -34,7 +34,8 @@ int main(void)
{ {
(void) thread_create( (void) thread_create(
t2_stack, sizeof(t2_stack), t2_stack, sizeof(t2_stack),
THREAD_PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
second_thread, NULL, "nr2"); second_thread, NULL, "nr2");
puts("first thread\n"); puts("first thread\n");
return 0; return 0;

View File

@ -70,7 +70,8 @@ int main(void)
for (int i = 0; i < PROBLEM; ++i) { for (int i = 0; i < PROBLEM; ++i) {
printf("Creating thread with arg %d\n", (i + 1)); printf("Creating thread with arg %d\n", (i + 1));
ths[i] = thread_create(stacks[i], sizeof(stacks[i]), ths[i] = thread_create(stacks[i], sizeof(stacks[i]),
THREAD_PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_PRIORITY_MAIN - 1,
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
run, NULL, "thread"); run, NULL, "thread");
if (ths[i] < 0) { if (ths[i] < 0) {

View File

@ -50,7 +50,7 @@ void *second_thread(void *arg)
third_thread_stack, third_thread_stack,
sizeof(third_thread_stack), sizeof(third_thread_stack),
THREAD_PRIORITY_MAIN - 2, THREAD_PRIORITY_MAIN - 2,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
third_thread, third_thread,
NULL, NULL,
"nr3") "nr3")
@ -64,7 +64,7 @@ void *second_thread(void *arg)
third_thread_stack, third_thread_stack,
sizeof(third_thread_stack), sizeof(third_thread_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
fourth_thread, fourth_thread,
NULL, NULL,
"nr4") "nr4")
@ -84,7 +84,7 @@ int main(void)
second_thread_stack, second_thread_stack,
sizeof(second_thread_stack), sizeof(second_thread_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
second_thread, second_thread,
NULL, NULL,
"nr2") "nr2")

View File

@ -84,13 +84,13 @@ void *thread3(void *arg)
int main(void) int main(void)
{ {
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1, p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
thread1, NULL, "nr1"); thread1, NULL, "nr1");
p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1, p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
thread2, NULL, "nr2"); thread2, NULL, "nr2");
p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1, p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
thread3, NULL, "nr3"); thread3, NULL, "nr3");
puts("THREADS CREATED\n"); puts("THREADS CREATED\n");
return 0; return 0;

View File

@ -60,7 +60,7 @@ int main(void)
msg_init_queue(msg_q, 1); msg_init_queue(msg_q, 1);
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1, p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
thread1, NULL, "nr1"); thread1, NULL, "nr1");
/* step 3: receive a msg */ /* step 3: receive a msg */

View File

@ -57,7 +57,7 @@ int main(void)
p_main = sched_active_pid; p_main = sched_active_pid;
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1, p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
thread1, NULL, "nr1"); thread1, NULL, "nr1");
/* step 3: receive a msg */ /* step 3: receive a msg */

View File

@ -56,13 +56,13 @@ int main(void)
p_main = sched_active_pid; p_main = sched_active_pid;
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1, p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
sub_thread, "nr1", "nr1"); sub_thread, "nr1", "nr1");
p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1, p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
sub_thread, "nr2", "nr2"); sub_thread, "nr2", "nr2");
p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1, p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1,
CREATE_WOUT_YIELD | CREATE_STACKTEST, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
sub_thread, "nr3", "nr3"); sub_thread, "nr3", "nr3");
puts("THREADS CREATED\n"); puts("THREADS CREATED\n");

View File

@ -109,7 +109,8 @@ static void tests_core_ringbuffer(void)
{ {
pid_add = sched_active_pid; pid_add = sched_active_pid;
pid_get = thread_create(stack_get, sizeof (stack_get), pid_get = thread_create(stack_get, sizeof (stack_get),
THREAD_PRIORITY_MAIN, CREATE_SLEEPING | CREATE_STACKTEST, THREAD_PRIORITY_MAIN,
THREAD_CREATE_SLEEPING | THREAD_CREATE_STACKTEST,
run_get, NULL, "get"); run_get, NULL, "get");
run_add(); run_add();
} }

View File

@ -87,7 +87,8 @@ void test_ubjson_test(void (*sender_fun)(void), void (*receiver_fun)(void))
mutex_lock(&data.mutexes[1]); mutex_lock(&data.mutexes[1]);
kernel_pid_t receiver_pid = thread_create(receiver_stack, sizeof(receiver_stack), kernel_pid_t receiver_pid = thread_create(receiver_stack, sizeof(receiver_stack),
THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD, THREAD_PRIORITY_MAIN,
THREAD_CREATE_WOUT_YIELD,
test_ubjson_receiver_trampoline, &data, "receiver"); test_ubjson_receiver_trampoline, &data, "receiver");
TEST_ASSERT(pid_is_valid(receiver_pid)); TEST_ASSERT(pid_is_valid(receiver_pid));

View File

@ -94,7 +94,7 @@ int main(void)
timer_stack, timer_stack,
sizeof(timer_stack), sizeof(timer_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_thread, timer_thread,
NULL, NULL,
"timer"); "timer");
@ -111,7 +111,7 @@ int main(void)
timer_stack_local, timer_stack_local,
sizeof(timer_stack_local), sizeof(timer_stack_local),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_thread_local, timer_thread_local,
NULL, NULL,
"timer local"); "timer local");

View File

@ -108,7 +108,7 @@ int main(void)
timer_stack, timer_stack,
sizeof(timer_stack), sizeof(timer_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_thread, timer_thread,
NULL, NULL,
"timer"); "timer");

View File

@ -140,7 +140,7 @@ int main(void)
slacker_stack1, slacker_stack1,
sizeof(slacker_stack1), sizeof(slacker_stack1),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
slacker_thread, slacker_thread,
NULL, NULL,
"slacker1"); "slacker1");
@ -157,7 +157,7 @@ int main(void)
slacker_stack2, slacker_stack2,
sizeof(slacker_stack2), sizeof(slacker_stack2),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
slacker_thread, slacker_thread,
NULL, NULL,
"slacker2"); "slacker2");
@ -174,7 +174,7 @@ int main(void)
worker_stack, worker_stack,
sizeof(worker_stack), sizeof(worker_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
worker_thread, worker_thread,
NULL, NULL,
"worker"); "worker");

View File

@ -64,7 +64,7 @@ int main(void)
thread_create(stack_timer1, thread_create(stack_timer1,
STACKSIZE_TIMER, STACKSIZE_TIMER,
2, 2,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_func1, timer_func1,
NULL, NULL,
"timer1"); "timer1");
@ -72,7 +72,7 @@ int main(void)
thread_create(stack_timer2, thread_create(stack_timer2,
STACKSIZE_TIMER, STACKSIZE_TIMER,
3, 3,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_func2, timer_func2,
NULL, NULL,
"timer2"); "timer2");

View File

@ -98,7 +98,7 @@ int main(void)
timer_stack, timer_stack,
sizeof(timer_stack), sizeof(timer_stack),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_thread, timer_thread,
NULL, NULL,
"timer"); "timer");
@ -115,7 +115,7 @@ int main(void)
timer_stack_local, timer_stack_local,
sizeof(timer_stack_local), sizeof(timer_stack_local),
THREAD_PRIORITY_MAIN - 1, THREAD_PRIORITY_MAIN - 1,
CREATE_STACKTEST, THREAD_CREATE_STACKTEST,
timer_thread_local, timer_thread_local,
NULL, NULL,
"timer local"); "timer local");