-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add some tests for our ring_buffer implementation. #964
Conversation
c38a0aa
to
9f4de02
Compare
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.
Reviewed 4 of 4 files at r1.
Reviewable status: 0 of 2 LGTMs obtained (waiting on @sudden6 and @zoff99)
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.
Reviewable status: 0 of 2 LGTMs obtained (waiting on @sudden6 and @zoff99)
can't find the LGTM on reviewable? hmm. some help? |
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.
Reviewable status: 0 of 2 LGTMs obtained, and 1 stale (waiting on @sudden6 and @zoff99)
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.
Reviewed 3 of 4 files at r1.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @sudden6)
toxav/ring_buffer_test.cc, line 113 at r1 (raw file):
TEST(RingBuffer, ZeroSizeBufferCanBeWrittenToOnce) { TypedRingBuffer<int *> rb(0);
shouldn't a 0 size buffer return an error anyway?
toxav/ring_buffer_test.cc, line 178 at r1 (raw file):
rb.read(&retrieved); EXPECT_EQ(rb.size(), 0); }
Another test case would be interesting
- create a buffer with size 4
- insert 5
- check that size == 4
Could maybe be part of WritingToBufferWhenFullOverwritesBeginning
These can serve as documentation until we write actual api docs, probably using apidsl.
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.
Reviewable status: 0 of 2 LGTMs obtained, and 1 stale (waiting on @sudden6 and @zoff99)
toxav/ring_buffer_test.cc, line 113 at r1 (raw file):
Previously, sudden6 wrote…
shouldn't a 0 size buffer return an error anyway?
It should, but doesn't. These tests check the current behaviour so that refactorings don't break the current behaviour. If we change the behaviour, we'll need to change the tests. I'm not changing the behaviour in this PR.
toxav/ring_buffer_test.cc, line 178 at r1 (raw file):
Previously, sudden6 wrote…
Another test case would be interesting
- create a buffer with size 4
- insert 5
- check that size == 4
Could maybe be part of
WritingToBufferWhenFullOverwritesBeginning
Done.
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.
Reviewed 1 of 1 files at r2.
Reviewable status: 1 of 2 LGTMs obtained, and 1 stale (waiting on @zoff99)
toxav/ring_buffer_test.cc, line 113 at r1 (raw file):
Previously, iphydf wrote…
It should, but doesn't. These tests check the current behaviour so that refactorings don't break the current behaviour. If we change the behaviour, we'll need to change the tests. I'm not changing the behaviour in this PR.
ok then
@zoff99 PTAL, I've added a test. |
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.
Reviewed 1 of 1 files at r2.
Reviewable status: 1 of 2 LGTMs obtained, and 1 stale (waiting on @zoff99)
where is the LGTM button in reviewable? its gone. i dont understand. what has changed there? |
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.
Reviewable status: 1 of 2 LGTMs obtained, and 1 stale (waiting on @zoff99)
These can serve as documentation until we write actual api docs, probably
using apidsl.
This change is