unit tests for ringbuffer