mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 21:20:11 +00:00
[diags] use temporary buffer for diag output (#2992)
This commit is contained in:
@@ -243,10 +243,11 @@ void TestDiag(void)
|
||||
|
||||
for (const TestCommand *test = &tests[0]; test->mCommand != NULL; test++)
|
||||
{
|
||||
const char *output = NULL;
|
||||
char output[OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE];
|
||||
|
||||
printf("\nCommand: %s", MakePrintable(test->mCommand));
|
||||
output = otDiagProcessCmdLine(test->mCommand);
|
||||
output[sizeof(output) - 1] = '\0';
|
||||
otDiagProcessCmdLine(test->mCommand, output, sizeof(output) - 1);
|
||||
printf("\nOutput: %s\n", MakePrintable(output));
|
||||
|
||||
VerifyOrQuit(strcmp(output, test->mExpectedOutput) == 0, "diagnostics output does not match expected result\n");
|
||||
|
||||
Reference in New Issue
Block a user