-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: ringbuffer for event memory cache #462
test: ringbuffer for event memory cache #462
Conversation
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
XCTAssertNil(ringBuffer.dequeue(), "Buffer should be empty") | ||
} | ||
|
||
func test_EnqueueBeyondCapacity_ShouldPushOldestElement() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func test_EnqueueBeyondCapacity_ShouldPushOldestElement() { | |
func test_EnqueueBeyondCapacity_ShouldRemoveOldestElement() { |
The method name is messing with my brain. The name provides an impression that it should "push the oldest element" which makes me think that the oldest element should be pushed out as output when dequeued but the method removes the first element and pops out in FIFO order when dequeued. 🤔
Sources/Common/Util/RingBuffer.swift
Outdated
@@ -12,6 +12,11 @@ struct RingBuffer<T> { | |||
// Flag to indicate if the buffer is full. | |||
private var isFull: Bool = false | |||
|
|||
// Public read-only accessor for isFul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Public read-only accessor for isFul | |
// Public read-only accessor for isFull |
Broken down PR for https://github.com/customerio/customerio-ios/pull/454/files#top
Please go through the details in the parent ticket for further context.