From b7784f18c5317450f776e69dac33c0fd978507ec Mon Sep 17 00:00:00 2001 From: asterix Date: Wed, 11 Jan 2012 18:14:41 +0000 Subject: [PATCH] Complete test. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5256 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/kern/rtask_test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bertos/kern/rtask_test.c b/bertos/kern/rtask_test.c index d903600b..4e1bb28d 100644 --- a/bertos/kern/rtask_test.c +++ b/bertos/kern/rtask_test.c @@ -50,9 +50,10 @@ #include #include +static int count = 0; static bool test1(void *data) { - kprintf("Funziona!\n"); + count += (intptr_t)data; return true; } @@ -61,8 +62,13 @@ static bool test1(void *data) */ int rtask_testRun(void) { - RTask *task = rtask_add(test1, 100, NULL); - return (task != NULL ? 0 : -1); + kprintf("Add task..\n"); + ASSERT(rtask_add(test1, 50, (void *)1)); + ASSERT(rtask_add(test1, 100, (void *)2)); + ASSERT(rtask_add(test1, 200, (void *)4)); + timer_delay(5000); + kprintf("count: %d\n", count); + return (count == ((5000/50) + (5000/100) *2 + (5000/200) * 4)); } int rtask_testSetup(void) -- 2.25.1