From 99c7a3d4a6e7762a34729984bce23f52f2fe95fe Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 10 Sep 2024 16:07:26 -0600 Subject: [PATCH] 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 --- tests/lib/rust/time/src/times.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/lib/rust/time/src/times.c b/tests/lib/rust/time/src/times.c index 443587c7d9fa2b4..ac23d9e7ead6795 100644 --- a/tests/lib/rust/time/src/times.c +++ b/tests/lib/rust/time/src/times.c @@ -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) \ @@ -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, \