Skip to content

Commit ccad027

Browse files
bridadan0xc0170
authored andcommitted
Adding comments describing buffer prep functions
1 parent 388968f commit ccad027

File tree

2 files changed

+20
-0
lines changed
  • features/FEATURE_LWIP/TESTS/mbedmicro-net

2 files changed

+20
-0
lines changed

features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ namespace {
3232
char uuid[GREENTEA_UUID_LENGTH] = {0};
3333
}
3434

35+
// Creates a buffer that contains the test's UUID in the first part of the contents
36+
// so the output can be associated with individual test runs. The rest of the
37+
// buffer is filled with random data so it is unique within the CURRENT test run.
38+
//
39+
// Ex. A test with UUID of `33e5002c-9722-4685-817a-709cc69c4701` would have a
40+
// buffer filled with something like `33e5002c-9722-4685-817a-709cc69c4701 12594387`
41+
// where `33e5002c-9722-4685-817a-709cc69c4701` is the UUID and `12594387` is the random data
3542
void prep_buffer(char *uuid, char *tx_buffer, size_t tx_size) {
3643
size_t i = 0;
3744

features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ Mutex iomutex;
3535
char uuid[GREENTEA_UUID_LENGTH] = {0};
3636

3737
// NOTE: assuming that "id" stays in the single digits
38+
//
39+
// Creates a buffer that first contains the thread's id.
40+
//
41+
// The second part of the buffer contains the test's UUID so the output can be
42+
// associated with individual test runs.
43+
//
44+
// The rest of the buffer is filled with random data so it is unique within the
45+
// CURRENT test run.
46+
//
47+
// Ex. A thread with id "2" and a test with UUID of `33e5002c-9722-4685-817a-709cc69c4701`
48+
// would have a buffer filled with something like `2 33e5002c-9722-4685-817a-709cc69c4701 12594387`
49+
// where `2` is the thread id, `33e5002c-9722-4685-817a-709cc69c4701` is the UUID
50+
// and `12594387` is the random data
3851
void prep_buffer(int id, char *uuid, char *tx_buffer, size_t tx_size) {
3952
size_t i = 0;
4053

0 commit comments

Comments
 (0)