Skip to content

Commit

Permalink
tests: lib: rust: Clarify some comments
Browse files Browse the repository at this point in the history
Add some additional comments to clarify that not all of the fields are
used for all of the test types.

Signed-off-by: David Brown <[email protected]>
  • Loading branch information
d3zd3z committed Sep 10, 2024
1 parent f8d9823 commit 99c7a3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/lib/rust/time/src/times.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ struct time_entry {
};

const struct time_entry time_entries[] = {
/* For the constants, only the `.value` gets used by the test. */
{
.name = "K_FOREVER",
.units = UNIT_FOREVER,
.uvalue = 0,
.value = K_FOREVER,
},
{
.name = "K_NO_WAIT",
.units = UNIT_NO_WAIT,
.uvalue = 0,
.value = K_NO_WAIT,
},
#define DUR_TEST(unit, n) \
Expand All @@ -58,6 +57,9 @@ const struct time_entry time_entries[] = {
DUR_TEST(MSEC, 32767),
DUR_TEST(MSEC, 32768),
DUR_TEST(MSEC, 32769),
/* The Instance tests don't set the `.value` because it isn't constant, and the test code
* will calculate the value at runtime, using the conversion functions below.
*/
#define INST_TEST(unit, n) \
{ \
.name = "Instant " #unit " " #n, \
Expand Down

0 comments on commit 99c7a3d

Please sign in to comment.