Skip to content
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

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

Shahroz16
Copy link
Contributor

@Shahroz16 Shahroz16 commented Jan 4, 2024

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.

@Shahroz16 Shahroz16 changed the base branch from main to main-replica-for-cdp January 4, 2024 15:14
Copy link

github-actions bot commented Jan 4, 2024

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.


  • CocoaPods-FCM: Build failed. See CI job logs to determine the issue and try re-building.
  • APN-UIKit: shahroz/test-event-bus-ringbuffer (1704472929)

@Shahroz16 Shahroz16 requested a review from a team January 4, 2024 15:15
XCTAssertNil(ringBuffer.dequeue(), "Buffer should be empty")
}

func test_EnqueueBeyondCapacity_ShouldPushOldestElement() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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. 🤔

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Public read-only accessor for isFul
// Public read-only accessor for isFull

@Shahroz16 Shahroz16 merged commit 9b2b701 into main-replica-for-cdp Jan 5, 2024
@Shahroz16 Shahroz16 deleted the shahroz/test-event-bus-ringbuffer branch January 5, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants