Skip to content

add more test coverage to native sha_digest tests#512

Open
meilu-git wants to merge 8 commits into
mainfrom
meilu/native_azihsm_sha_digest
Open

add more test coverage to native sha_digest tests#512
meilu-git wants to merge 8 commits into
mainfrom
meilu/native_azihsm_sha_digest

Conversation

@meilu-git

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Expands the C++ native SHA digest test suite to increase coverage across one-shot and streaming digest APIs, including correctness (known-answer) checks and argument validation edge cases.

Changes:

  • Added extensive negative/edge-case tests for one-shot and streaming digest APIs (null pointers, invalid handles, buffer sizing).
  • Added known-answer vector tests for SHA1/SHA256/SHA384/SHA512 (including empty input) for both one-shot and streaming flows.
  • Added consistency tests comparing streaming vs one-shot outputs across varied chunk boundaries.

Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Copilot AI review requested due to automatic review settings July 6, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Copilot AI review requested due to automatic review settings July 6, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
Comment thread api/tests/cpp/algo/sha/digest_tests.cpp Outdated
@meilu-git meilu-git force-pushed the meilu/native_azihsm_sha_digest branch from d8583e3 to 5fc7a6f Compare July 6, 2026 19:15
Copilot AI review requested due to automatic review settings July 6, 2026 19:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread api/tests/cpp/algo/sha/digest_tests.cpp
Copilot AI review requested due to automatic review settings July 8, 2026 17:09
@meilu-git meilu-git force-pushed the meilu/native_azihsm_sha_digest branch from 981d5e5 to bf7d08e Compare July 8, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +125 to +137
for (size_t i = 0; i < hex_len; i += 2)
{
unsigned int value = 0;
int parsed_count = std::sscanf(hex + i, "%2x", &value);

if (parsed_count != 1)
{
ADD_FAILURE() << "Failed to parse hex string at offset " << i;
return {};
}

bytes.push_back(static_cast<uint8_t>(value));
}
Copilot AI review requested due to automatic review settings July 9, 2026 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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.

2 participants