Checkout
Julian Foad
committed
on 17 Jan
Fix weak test coverage.

In the tests for "semi-canonical" and "canonical" kinds of inputs to
svn_rangelist_merge2(), the input generator pr… Show more
Fix weak test coverage.

In the tests for "semi-canonical" and "canonical" kinds of inputs to

svn_rangelist_merge2(), the input generator previously called "generate a

random non-validated input" repeatedly until it passed certain quality

tests.  That made the result heavily biased towards very simple cases.

As a result, the coverage of the "semi-canonical" and "canonical" tests

missed the failure mode of the original bug report #4840.

This generates "semi-canonical" and "canonical" inputs with a fairer

distribution, increasing their coverage to include that failure mode.

For issue 4840 "Merge assertion failure in svn_sort__array_insert"

* subversion/tests/libsvn_subr/mergeinfo-test.c

 (rand_interval_triangular): New.

 (rangelist_random_non_validated): Use it.

 (int_compare,

  ascending_values): New.

 (rangelist_random_semi_canonical,

  rangelist_random_canonical): Rewrite.

 (add_failure_mode): Deduplicate 'Attempted insert at index ...' messages.

Show less