Skip to content

Commit 25d3af3

Browse files
committed
test(agent): clarify rnd usability smoke check
Reword the comment to state plainly that the real check is that calling the RNG on the returned generator does not crash, and point to test_random.c:test_range for deterministic seeding coverage. No behavior change.
1 parent 8ce2804 commit 25d3af3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

axiom/tests/test_app.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,8 +1256,13 @@ static void test_get_or_create_thread_rnd(void) {
12561256
r1 = nr_app_get_or_create_thread_rnd(&app, 1);
12571257
tlib_pass_if_not_null("first call returns non-NULL", r1);
12581258

1259-
/* Verify rnd is seeded and functional (not all-zero xsubi). */
1260-
tlib_pass_if_true("rnd produces in-range value",
1259+
/*
1260+
* The "< 1000" pulls little weight -- nr_random_range() is range-bounded for
1261+
* any seed, so it's near-tautological (would only trip if the range contract
1262+
* regressed). The real check here is that calling the RNG on the returned
1263+
* generator does not crash. Seeding is verified in test_random.c:test_range.
1264+
*/
1265+
tlib_pass_if_true("rnd is usable (RNG call does not crash)",
12611266
nr_random_range(r1, 1000) < 1000,
12621267
"rnd=%p", (void*)r1);
12631268

0 commit comments

Comments
 (0)