Skip to content

Conversation

@atlomak
Copy link
Contributor

@atlomak atlomak commented Nov 17, 2025

Description

Add tests for spwrtr_clkdiv_get and spwrtr_clkdiv_set messages in grspwrtr driver.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

@gemini-code-assist
Copy link

Summary of Changes

Hello @atlomak, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the test coverage for SpaceWire drivers by introducing new validation for critical functionalities. It adds robust tests for clock divider configuration in the grspwrtr (SpaceWire router) driver and implements detailed timeout handling tests for receive operations in the grspw2 (SpaceWire device) driver. Additionally, it refines existing test assertions to ensure more accurate verification of SpaceWire receive operations, thereby improving the overall reliability and maintainability of the SpaceWire communication stack.

Highlights

  • Clock Divider Tests for GRSPWRTR Driver: New test cases have been introduced for the grspwrtr driver to verify the functionality of getting and setting clock divider values (spwrtr_clkdiv_get and spwrtr_clkdiv_set) for SpaceWire router ports. These tests include checks for valid and invalid port configurations.
  • SpaceWire Receive Timeout Tests for GRSPW2 Driver: Comprehensive tests have been added to the grspw2 driver to validate SpaceWire receive timeout mechanisms. This includes testing single packet receive timeouts and scenarios involving multiple packets with simulated packet loss, ensuring the driver handles timeouts correctly.
  • Refinement of SpaceWire Receive Test Assertions: Existing SpaceWire receive tests in both grlib-multi and grspw2 test suites have been updated to correctly assert the number of received packets using the odevctl->val field and to verify that the msg.o.err field indicates success (0).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds tests for clkdiv in the grspwrtr driver and RX timeout functionality in the grspw2 driver. The changes are well-structured and the new tests cover important functionality, including edge cases. I've found a few minor issues related to potential stack overflow, use of floating-point literals in integer arithmetic, and an unused struct member. Please see my detailed comments for suggestions.

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Unit Test Results

9 446 tests  ±0   8 857 ✅ ±0   48m 34s ⏱️ +43s
  545 suites ±0     589 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit a47d015. ± Comparison against base commit 7688d5f.

♻️ This comment has been updated with latest results.

@atlomak atlomak force-pushed the atlomak/spwrtr-test-clkdiv branch from 035a623 to a47d015 Compare November 17, 2025 13:23
@atlomak atlomak changed the title devices/grspw2: add clkdiv tests devices/grspwrtr: add clkdiv tests Nov 18, 2025
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