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

chore: minor fixes and introduce some test cases for VertexResource #4885

Merged
merged 6 commits into from
Sep 9, 2021

Conversation

pollend
Copy link
Member

@pollend pollend commented Sep 4, 2021

some basic test cases for VertexResource.

@github-actions github-actions bot added Type: Bug Issues reporting and PRs fixing problems Type: Chore Request for or implementation of maintenance changes labels Sep 4, 2021
@pollend pollend marked this pull request as ready for review September 4, 2021 05:14
@pollend pollend force-pushed the test/add-testing-for-VertexResource branch from 18314bc to cf9fa56 Compare September 4, 2021 15:27
@pollend pollend added Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Category: Test/QA Requests, Issues and Changes targeting tests and quality assurance labels Sep 4, 2021
Copy link
Member

@keturn keturn left a comment

Choose a reason for hiding this comment

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

👍 for tests and docs. The tests look straightforward, making it clear what they're going for.

I notice a lot of tests creating a builder, calling exactly one method on it, and then build(), which suggests we might want to add a more convenient API for that later.

I'm not merging this immediately, so you have a chance to decide if there's anything in these comments you want to add, but feel free to merge when ready.

Comment on lines +34 to +36
a1.put(15.5f);
a1.put(2.0f);
a1.put(-100.0f);
Copy link
Member

Choose a reason for hiding this comment

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

Fun ways to test floating-point data structures include: -0 (negative zero), NaN, POSITIVE_INFINITY.

(This may or may not actually be relevant for this application.)

Comment on lines +86 to +91
resource.writeBuffer(buffer -> {
assertEquals(4 * Byte.BYTES, buffer.limit());

assertEquals(10, Byte.toUnsignedInt(buffer.get(Byte.BYTES * 0)));
assertEquals(150, Byte.toUnsignedInt(buffer.get(Byte.BYTES * 1)));
assertEquals(255, Byte.toUnsignedInt(buffer.get(Byte.BYTES * 2)));
Copy link
Member

Choose a reason for hiding this comment

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

Ah, this 255 case is the one that goes with that clamp() you added. I suggest pointing that out with a comment, it's pretty easy to miss when scanning through these lines and numbers that are mostly all the same.

Should this test a negative value too?

@pollend pollend merged commit 89d45ce into develop Sep 9, 2021
@pollend pollend deleted the test/add-testing-for-VertexResource branch September 9, 2021 04:24
@pollend pollend added this to the v5.2.0 milestone Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Category: Test/QA Requests, Issues and Changes targeting tests and quality assurance Type: Bug Issues reporting and PRs fixing problems Type: Chore Request for or implementation of maintenance changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants