comparison tests/test-parseindex.t @ 51178:a6c49e5d573f

test: clarify test-parseindex offsets We will make this revlog non-inline, so we clarify the code to make sure it is simple to adjust the test later.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 07 Dec 2023 03:40:37 +0100
parents 786b6225793a
children dcaa2df1f688
comparison
equal deleted inserted replaced
51177:1c4180d49baf 51178:a6c49e5d573f
143 > (b'neglimit', b'\xff\xff\xff\xfe'), 143 > (b'neglimit', b'\xff\xff\xff\xfe'),
144 > (b'segv', b'\0\x01\0\0'), 144 > (b'segv', b'\0\x01\0\0'),
145 > ] 145 > ]
146 > for n, p in poisons: 146 > for n, p in poisons:
147 > # corrupt p1 at rev0 and p2 at rev1 147 > # corrupt p1 at rev0 and p2 at rev1
148 > d = data[:24] + p + data[28:127 + 28] + p + data[127 + 32:] 148 > rev_0 = data[:64 + 63]
149 > open(n + b"/.hg/store/00changelog.i", "wb").write(d) 149 > rev_1 = data[64 + 63:]
150 > altered_rev_0 = rev_0[:24] + p + rev_0[24 + 4:]
151 > altered_rev_1 = rev_1[:28] + p + rev_1[28 + 4:]
152 > new_data = altered_rev_0 + altered_rev_1
153 > with open(n + b"/.hg/store/00changelog.i", "wb") as f:
154 > f.write(new_data)
150 > EOF 155 > EOF
151 156
152 $ hg -R limit debugrevlogindex -f1 -c 157 $ hg -R limit debugrevlogindex -f1 -c
153 rev flag size link p1 p2 nodeid 158 rev flag size link p1 p2 nodeid
154 0 0000 62 0 2 -1 7c31755bf9b5 159 0 0000 62 0 2 -1 7c31755bf9b5