1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #9032 from cladmi/pr/fix/test/wsn430/mutex_unlock_and_sleep

tests/mutex_unlock_and_sleep: increase timeout
This commit is contained in:
Kaspar Schleiser 2018-05-12 02:09:37 +02:00 committed by GitHub
commit 234b363e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -27,6 +27,12 @@ static volatile int indicator;
static kernel_pid_t main_pid;
static char stack[THREAD_STACKSIZE_DEFAULT];
#ifdef BOARD_NATIVE
static const unsigned KITERATIONS = 100;
#else
static const unsigned KITERATIONS = 10;
#endif
static void *second_thread(void *arg)
{
(void) arg;
@ -42,6 +48,7 @@ static void *second_thread(void *arg)
int main(void)
{
uint32_t count = 0;
uint32_t kcount = 0;
indicator = 0;
main_pid = thread_getpid();
@ -64,8 +71,10 @@ int main(void)
printf("[ERROR] threads did not sleep properly (%d).\n", indicator);
return 1;
}
if ((count % 100000) == 0) {
printf("[ALIVE] alternated %"PRIu32"k times.\n", (count / 1000));
if (count == (KITERATIONS * 1000)) {
count = 0;
kcount += KITERATIONS;
printf("[ALIVE] alternated %"PRIu32"k times.\n", kcount);
}
mutex_unlock_and_sleep(&mutex);
}

View File

@ -11,7 +11,7 @@ import sys
def testfunc(child):
for i in range(20):
for i in range(10):
child.expect(r"\[ALIVE\] alternated \d+k times.")