added tests for semaphore