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

Improve branch coverage testing for base 64, specifically around preconditions #1836

Closed
ahsonkhan opened this issue Jul 14, 2021 · 1 comment
Labels
Azure.Core good first issue This issue tracks work that may be a good starting point for a first-time contributor test-enhancement
Milestone

Comments

@ahsonkhan
Copy link
Member

We are at ~80% branch coverage, which could be improved to get closer to ~100%
image

https://dev.azure.com/azure-sdk/public/_build/results?buildId=990064&_a=summary&tab=ms.vss-codecoverage-web.code-coverage-details&view=codecoverage-tab
image

AZ_NODISCARD az_result
az_base64_encode(az_span destination_base64_text, az_span source_bytes, int32_t* out_written)
{
_az_PRECONDITION_VALID_SPAN(destination_base64_text, 4, false);
_az_PRECONDITION_VALID_SPAN(source_bytes, 1, false);
_az_PRECONDITION_NOT_NULL(out_written);

See examples on how to add tests for preconditions here:

#ifndef AZ_NO_PRECONDITION_CHECKING
ENABLE_PRECONDITION_CHECK_TESTS()
static void test_az_iot_hub_client_c2d_parse_received_topic_NULL_client_fail()
{
az_span received_topic = AZ_SPAN_FROM_STR(
"devices/useragent_c/messages/devicebound/$.mid=79eadb01-bd0d-472d-bd35-ccb76e70eab8&$.to=/"
"devices/useragent_c/messages/deviceBound&iothub-ack=full");
az_iot_hub_client_c2d_request out_request;
ASSERT_PRECONDITION_CHECKED(
az_iot_hub_client_c2d_parse_received_topic(NULL, received_topic, &out_request));
}

Copy link

Hi @ahsonkhan, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core good first issue This issue tracks work that may be a good starting point for a first-time contributor test-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants