nasa / nasa/sample_lib

Add input and output parameters to SAMPLE_LIB_Function to show more advanced generic stubs/hooks

Open
#56 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
12
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
SAMPLE_LIB_Function takes no parameters, so can't show example of registering them and using a hook.

Describe the solution you'd like
Add parameters (both pass by value and reference), update stubs to use suggested pattern:
UT_Stub_RegisterContextGenericArg(UT_KEY(SAMPLE_LIB_Function), param);

Follow on add a hook (likely from sample_app), register and show use of UT_Hook_GetArgValueByName.

Describe alternatives you've considered
There are plenty of implementations in core already, but hard to tell what the "gold standard" is. Need to trade complexity/simplicity though...

Additional context
None

Requester Info
Jacob Hageman - NASA/GSFC

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate SAMPLE_LIB_Function and the sample_app hook examples, then compare the existing core implementations referenced in the issue to identify the suggested stub and hook patterns. Done means the sample demonstrates value and reference parameters, registers the generic stub arguments, and shows a hook retrieving an argument with UT_Hook_GetArgValueByName.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.