Skip to content

Conversation

ml-physec
Copy link
Contributor

🍍

Initial implementation for #774.

This adds UNITY_DETAIL_PUSH/POP, which can be used to put arbitrary label+value pairs on the detail stack.

The configuration is a bit complicated, but all labels are fully customizable.
Values can be either printed as string, or any of the supported number styles via special prefixes. See examples/example_5 for an example.

Compared to the current detail slots (CurrentDetail1/2, 2 x pointers), the overhead in UNITY_STORAGE_T (in RAM) is:

  • n x pointers
  • n x uint8_t
  • 1 x counter

I am open to any suggestions.

@mvandervoord mvandervoord merged commit fa03368 into ThrowTheSwitch:master Jul 9, 2025
if ((label[0] == '#') && (label[1] != 0)) {
UnityPrint(label + 2);
UNITY_OUTPUT_CHAR(' ');
UnityPrintNumberByStyle(Unity.CurrentDetailStackValues[c], label[1]);

Choose a reason for hiding this comment

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

This function does not exist. It was renamed to UnityPrintIntNumberByStyle in #784 (ac52c41), but that also removed the implementation for printing with a style other than UNITY_DISPLAY_RANGE_INT.

Should this line be the following?

                UnityPrintUintNumberByStyle(Unity.CurrentDetailStackValues[c], label[1]);

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.

3 participants