Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osal Integration candidate: 2021-05-04 #979

Merged
merged 5 commits into from
May 5, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix #964, UtPrintx function
Fix the UtPrintx() routine such that the loop stops correctly.
Also improves the output to print the address, not just the data.

Note if UtPrintf is used, one sees the file/line of the UtPrintx
function, not the actual test location, so it is better to call
UT_BSP_DoText directly so it omits this extraneous info.
  • Loading branch information
jphickey committed Apr 27, 2021
commit d05914727e55d061607c0f2ce24d26dacb9c5e73
9 changes: 6 additions & 3 deletions ut_assert/src/uttools.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,22 @@ void UtPrintx(const void *Memory, uint32 Length)
uint32 i;
uint32 j;
const uint8 *Byte_ptr = Memory;
char OutputLine[50];
char OutputLine[80];
char * OutPtr;

i = 0;
while (1)
while (i < Length)
{
snprintf(OutputLine, sizeof(OutputLine), "%16lx: ", (unsigned long)&Byte_ptr[i]);
OutPtr = OutputLine;
OutPtr += strlen(OutputLine);
for (j = 0; j < 16 && i < Length; j++, i++)
{
sprintf(OutPtr, "%02X ", Byte_ptr[i]);
OutPtr += 3;
}
UtPrintf("%s\n", OutputLine);

UT_BSP_DoText(UTASSERT_CASETYPE_INFO, OutputLine);
}
}

Expand Down