#148 improve ClearEvent
#148 improve clearEvent.c
#148 improve WaitEvent return values
add stack for the tests