Skip to content

Commit f5a4ad9

Browse files
committed
tests: lib: rust: Clarify some comments
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]>
1 parent 9afdb77 commit f5a4ad9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/lib/rust/time/src/times.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@ struct time_entry {
2727
};
2828

2929
const struct time_entry time_entries[] = {
30+
/* For the constants, only the `.value` gets used by the test. */
3031
{
3132
.name = "K_FOREVER",
3233
.units = UNIT_FOREVER,
33-
.uvalue = 0,
3434
.value = K_FOREVER,
3535
},
3636
{
3737
.name = "K_NO_WAIT",
3838
.units = UNIT_NO_WAIT,
39-
.uvalue = 0,
4039
.value = K_NO_WAIT,
4140
},
4241
#define DUR_TEST(unit, n) \
@@ -58,6 +57,9 @@ const struct time_entry time_entries[] = {
5857
DUR_TEST(MSEC, 32767),
5958
DUR_TEST(MSEC, 32768),
6059
DUR_TEST(MSEC, 32769),
60+
/* The Instance tests don't set the `.value` because it isn't constant, and the test code
61+
* will calculate the value at runtime, using the conversion functions below.
62+
*/
6163
#define INST_TEST(unit, n) \
6264
{ \
6365
.name = "Instant " #unit " " #n, \

0 commit comments

Comments
 (0)