#1527: the call-context metrics find each call's innermost enclosing * Function/Method with a line sweep instead of scanning every def per call. * The sweep must give the scan's exact answer -- smallest span, ties to the * lowest def index -- on nested, overlapping, same-line, malformed * (end < start) and unnamed/non-callable ranges. Fixed-seed generator: * deterministic, many shapes. */
| 11671 | * (end < start) and unnamed/non-callable ranges. Fixed-seed generator: |
| 11672 | * deterministic, many shapes. */ |
| 11673 | static uint32_t enc_rand(uint32_t *state) { |
| 11674 | *state = (*state * 1103515245u) + 12345u; |
| 11675 | return (*state >> 16) & 0x7fffu; |
| 11676 | } |
| 11677 | |
| 11678 | TEST(extract_enclosing_sweep_matches_scan_issue1527) { |
| 11679 | static const char *const labels[] = {"Function", "Method", "Class", "Variable"}; |