changeset 41310:ebe51a2e75be

fuzz: exercise more of the revlog API I noticed in the coverage report that we didn't have much coverage in revlog.py. Let's try and get some of the more interesting bits tested by the fuzzer. I ran this locally for a few minutes to verify that I appear to be calling the various functions in reasonable ways. Differential Revision: https://phab.mercurial-scm.org/D5641
author Augie Fackler <raf@durin42.com>
date Tue, 22 Jan 2019 11:02:10 -0500
parents afc33a5705b9
children 44cd432aed9f
files contrib/fuzz/revlog.cc
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/fuzz/revlog.cc	Tue Jan 22 11:18:05 2019 -0500
+++ b/contrib/fuzz/revlog.cc	Tue Jan 22 11:02:10 2019 -0500
@@ -19,6 +19,11 @@
 for inline in (True, False):
     try:
         index, cache = parse_index2(data, inline)
+        index.slicechunktodensity(list(range(len(index))), 0.5, 262144)
+        for rev in range(len(index)):
+            node = index[rev][7]
+            partial = index.shortest(node)
+            index.partialmatch(node[:partial])
     except Exception as e:
         pass
         # uncomment this print if you're editing this Python code