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

Add tests for writing documents to the cache #11347

Merged
merged 2 commits into from
May 30, 2024

Conversation

JosiahWI
Copy link
Collaborator

This tests that the correct document data is written to cache by aggWrite. It also covers some fields of the Doc struct used for reading the data: the magic value, the length and header length, and the optional checksum.

This commit also fixes the use of an uninitialized variable (header.phase) reported by valgrind by initializing it to the same default value used in the Stripe::_clear_init.

@JosiahWI JosiahWI added the Tests label May 13, 2024
@JosiahWI JosiahWI added this to the 10.0.1 milestone May 13, 2024
@JosiahWI JosiahWI self-assigned this May 13, 2024
@JosiahWI JosiahWI force-pushed the refactor/test-aggWrite branch 2 times, most recently from c173fd4 to 79d295c Compare May 13, 2024 21:51
@bryancall bryancall modified the milestones: 10.0.1, 10.1.0 May 13, 2024
@bryancall bryancall requested a review from masaori335 May 13, 2024 22:03
This tests that the correct document data is written to cache by
aggWrite. It also covers some fields of the Doc struct used for reading
the data: the magic value, the length and header length, and the
optional checksum.

This commit also fixes the use of an uninitialized variable (header.phase)
reported by valgrind by initializing it to the same default value used
in the Stripe::_clear_init.
This tests VCs with f.evacuator set to make sure all main code paths in
agg_copy are covered. It is very similar to the test for normal VCs, but
sets the buffer up with a document instead of the raw content string.
This commit also moves FakeVC and WaitingVC into a new file called
test_doubles.h.
Copy link
Contributor

@masaori335 masaori335 left a comment

Choose a reason for hiding this comment

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

Looks good

@JosiahWI JosiahWI merged commit 77b226d into apache:master May 30, 2024
15 checks passed
@JosiahWI JosiahWI deleted the refactor/test-aggWrite branch May 30, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants