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

Refactoring unit tests #15

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Refactoring unit tests #15

merged 1 commit into from
Jun 21, 2024

Conversation

SebaLukas
Copy link
Collaborator

@SebaLukas SebaLukas commented Jun 17, 2024

Describe your changes

  • Refactoring unit tests
  • Adding tests to test proper en- & decoding ISO20 bpt control mode
  • Fixing session_setup_res tests

Issue ticket number and link

In order not to lose the manually fixed things through a newly generated code, these tests are introduced here.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@SebaLukas SebaLukas force-pushed the feat/adding-test-bpt-control branch 2 times, most recently from 870e95a to 284082d Compare June 19, 2024 13:58
Copy link
Contributor

@barsnick barsnick left a comment

Choose a reason for hiding this comment

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

Title of PR: "prober" -> "proper"?

I really like the test_utils approach, making the test case implementations much more concise, and easier to expand.

tests/test_utils/codec.cpp Outdated Show resolved Hide resolved
tests/din/session_setup.cpp Outdated Show resolved Hide resolved
tests/iso20/ac_charge_loop.cpp Outdated Show resolved Hide resolved
template <typename DocType>
static EncodingResult encode(int (*encode_func)(exi_bitstream_t*, DocType*), const DocType& request,
const uint8_t* compare_data, std::size_t length) {
// FIXME (aw): what general size to take here?
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably expand this as soon as we encounter larger streams.

Copy link
Contributor

Choose a reason for hiding this comment

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

do the encode functions have a error code for "buffer too small"?

Copy link
Contributor

Choose a reason for hiding this comment

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

do the encode functions have a error code for "buffer too small"?

Yes, EXI_ERROR__BITSTREAM_OVERFLOW.

@SebaLukas SebaLukas changed the title Adding tests to test prober en- & decoding ISO20 bpt control mode Adding tests to test proper en- & decoding ISO20 bpt control mode Jun 20, 2024
@SebaLukas SebaLukas changed the title Adding tests to test proper en- & decoding ISO20 bpt control mode Refactoring unit tests Jun 20, 2024
- Simplify tests & adding utility functions
- Adding tests to test prober en- & decoding ISO20 bpt control mode
- Fixing session setup res tests

Signed-off-by: aw <[email protected]>
Signed-off-by: Sebastian Lukas <[email protected]>
@SebaLukas SebaLukas force-pushed the feat/adding-test-bpt-control branch from 2ca3d2c to c8bf469 Compare June 21, 2024 08:36
@SebaLukas SebaLukas merged commit ec437e6 into main Jun 21, 2024
2 of 3 checks passed
@SebaLukas SebaLukas deleted the feat/adding-test-bpt-control branch June 21, 2024 08: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.

3 participants