1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #6079 from miri64/tests/fix/posix_semaphore

tests: fix posix_semaphore output and for timer error
This commit is contained in:
Francisco Acosta 2016-11-08 20:37:54 +01:00 committed by GitHub
commit 25e7681c35
2 changed files with 10 additions and 3 deletions

View File

@ -5,6 +5,7 @@ BOARD_INSUFFICIENT_MEMORY := msb-430 msb-430h mbed_lpc1768 chronos stm32f0discov
pca10000 pca10005 weio yunjia-nrf51822 nrf6310 spark-core \
nucleo-f334 nucleo-f030
USEMODULE += fmt
USEMODULE += posix_semaphore
DISABLE_MODULE += auto_init

View File

@ -26,6 +26,7 @@
#include <stdio.h>
#include <semaphore.h>
#include "fmt.h"
#include "msg.h"
#include "timex.h"
#include "thread.h"
@ -237,6 +238,7 @@ void test3(void)
void test4(void)
{
char uint64_str[20];
struct timespec abs;
uint64_t now, start, stop;
const uint64_t exp = 1000000;
@ -259,10 +261,14 @@ void test4(void)
}
}
stop = xtimer_now64() - start;
if (stop < exp) {
printf("first: waited only %" PRIu64 " usec => FAILED\n", stop);
if ((stop < (exp - 100)) || (stop > (exp + 100))) {
fmt_u64_dec(uint64_str, stop);
printf("first: waited only %s usec => FAILED\n", uint64_str);
}
else {
fmt_u64_dec(uint64_str, stop);
printf("first: waited %s usec\n", uint64_str);
}
printf("first: waited %" PRIu64 " usec\n", stop);
}
int main(void)