From da0be7114f87053fe8b38cf64e4d42badd8b4786 Mon Sep 17 00:00:00 2001 From: xoviat Date: Mon, 29 May 2023 15:14:43 -0500 Subject: [PATCH] stm32/uart: fix dma ringbuf tests --- embassy-stm32/src/dma/ringbuffer.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/embassy-stm32/src/dma/ringbuffer.rs b/embassy-stm32/src/dma/ringbuffer.rs index 72a84a57f..a2bde986f 100644 --- a/embassy-stm32/src/dma/ringbuffer.rs +++ b/embassy-stm32/src/dma/ringbuffer.rs @@ -276,7 +276,7 @@ mod tests { let mut ringbuf = DmaRingBuffer::new(&mut dma_buf); assert_eq!(0, ringbuf.start); - assert_eq!(16, ringbuf.len()); + assert_eq!(16, ringbuf.cap()); dma.setup(vec![ TestCircularTransferRequest::PositionRequest(8), @@ -317,7 +317,7 @@ mod tests { let mut ringbuf = DmaRingBuffer::new(&mut dma_buf); assert_eq!(0, ringbuf.start); - assert_eq!(16, ringbuf.len()); + assert_eq!(16, ringbuf.cap()); /* Read to close to the end of the buffer @@ -352,7 +352,7 @@ mod tests { let mut ringbuf = DmaRingBuffer::new(&mut dma_buf); assert_eq!(0, ringbuf.start); - assert_eq!(16, ringbuf.len()); + assert_eq!(16, ringbuf.cap()); /* Read to close to the end of the buffer @@ -387,7 +387,7 @@ mod tests { let mut ringbuf = DmaRingBuffer::new(&mut dma_buf); assert_eq!(0, ringbuf.start); - assert_eq!(16, ringbuf.len()); + assert_eq!(16, ringbuf.cap()); /* Read to about the middle of the buffer @@ -423,7 +423,7 @@ mod tests { let mut ringbuf = DmaRingBuffer::new(&mut dma_buf); assert_eq!(0, ringbuf.start); - assert_eq!(16, ringbuf.len()); + assert_eq!(16, ringbuf.cap()); /* Read a few bytes @@ -457,7 +457,7 @@ mod tests { let mut ringbuf = DmaRingBuffer::new(&mut dma_buf); assert_eq!(0, ringbuf.start); - assert_eq!(16, ringbuf.len()); + assert_eq!(16, ringbuf.cap()); /* Read to close to the end of the buffer