示例1: TestByteRingBuffer ▲ publicvoidTestByteRingBuffer(){varCurrentEncoding = Encoding.UTF8;intBufferSize =1024;varBuffer =newRingBuffer<byte>(BufferSize);// Initial checkAssert.AreEqual(BufferSize, Buffer.AvailableForWrite); Assert.AreEqual(0, Buffer.AvailableForRead);// Try peekCollectionAss...
Add ring_buf_size_get() to get the number of bytes currently available in the ring buffer. Add ring_buf_peek() to read data from the head of a ring buffer without removal. Fixes #37145 Sorry, something went wrong. cfriedt self-assigned this Jul 22, 2021 github-actions bot added ...
void test_peek(void) { uint32_t size; uint8_t byte = 0x42; static uint8_t buf[RINGBUFFER_SIZE]; ring_buf_init(&ringbuf_raw, sizeof(buf), ringbuf_raw.buf.buf8); /* Test 0 */ size = ring_buf_peek(&ringbuf_raw, (uint8_t *)0x1, 42424242); zassert_equal(0, size, "...