Add comprehensive xCore tests for lib_random library #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The lib_random repository did not contain any tests, leaving the library without validation of its functionality.
Solution
This PR adds a comprehensive test suite that covers all public API functions of the lib_random library:
Test Coverage
random_create_generator_from_seed(),random_get_random_number(), andrandom_get_random_bytes()with deterministic behavior validationrandom_create_generator_from_hw_seed()and ring oscillator functions (random_ro_init(),random_ro_get_bit(),random_ro_uninit())Key Features
Test Structure
Example Test Output
Building and Running
xCore testing (requires XMOS XTC Tools):
Host testing (for development):
cd tests/test_lib_random cmake -f CMakeLists_host.txt -B build_host make -C build_host ./build_host/test_lib_random_hostThis implementation follows XMOS conventions, integrates seamlessly with the existing build system, and provides robust validation for all library functionality without breaking any existing code.
Original prompt
Fixes #10
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.