From 20240c043e9decadd8a56a348127a7af2dcf91fc Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Mon, 22 May 2017 18:51:56 -0500 Subject: [PATCH] Adding comments describing buffer prep functions --- .../TESTS/mbedmicro-net/udp_echo/main.cpp | 7 +++++++ .../TESTS/mbedmicro-net/udp_echo_parallel/main.cpp | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo/main.cpp b/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo/main.cpp index 9fa4e4c2db..2b9284704e 100644 --- a/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo/main.cpp +++ b/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo/main.cpp @@ -32,6 +32,13 @@ namespace { char uuid[GREENTEA_UUID_LENGTH] = {0}; } +// Creates a buffer that contains the test's UUID in the first part of the contents +// so the output can be associated with individual test runs. The rest of the +// buffer is filled with random data so it is unique within the CURRENT test run. +// +// Ex. A test with UUID of `33e5002c-9722-4685-817a-709cc69c4701` would have a +// buffer filled with something like `33e5002c-9722-4685-817a-709cc69c4701 12594387` +// where `33e5002c-9722-4685-817a-709cc69c4701` is the UUID and `12594387` is the random data void prep_buffer(char *uuid, char *tx_buffer, size_t tx_size) { size_t i = 0; diff --git a/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp b/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp index 329021307b..9732955a12 100644 --- a/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp +++ b/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp @@ -35,6 +35,19 @@ Mutex iomutex; char uuid[GREENTEA_UUID_LENGTH] = {0}; // NOTE: assuming that "id" stays in the single digits +// +// Creates a buffer that first contains the thread's id. +// +// The second part of the buffer contains the test's UUID so the output can be +// associated with individual test runs. +// +// The rest of the buffer is filled with random data so it is unique within the +// CURRENT test run. +// +// Ex. A thread with id "2" and a test with UUID of `33e5002c-9722-4685-817a-709cc69c4701` +// would have a buffer filled with something like `2 33e5002c-9722-4685-817a-709cc69c4701 12594387` +// where `2` is the thread id, `33e5002c-9722-4685-817a-709cc69c4701` is the UUID +// and `12594387` is the random data void prep_buffer(int id, char *uuid, char *tx_buffer, size_t tx_size) { size_t i = 0;