blob: 64f047332b51cefea37bd5b8b40e863be77dfc77 [file] [log] [blame]
Kevin Willford2a1bd452017-03-31 17:32:14 +00001#!/bin/sh
2
3test_description='Test the lazy init name hash with various folder structures'
4
5. ./test-lib.sh
6
Nguyễn Thái Ngọc Duyc033cc12018-03-24 08:44:48 +01007if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus)
Kevin Willford845eec22017-04-03 15:16:42 +00008then
9 skip_all='skipping lazy-init tests, single cpu'
10 test_done
11fi
12
13LAZY_THREAD_COST=2000
14
Kevin Willford2a1bd452017-03-31 17:32:14 +000015test_expect_success 'no buffer overflow in lazy_init_name_hash' '
16 (
Eric Sunshine3ea67372018-07-01 20:23:58 -040017 test_seq $LAZY_THREAD_COST | sed "s/^/a_/" &&
18 echo b/b/b &&
19 test_seq $LAZY_THREAD_COST | sed "s/^/c_/" &&
20 test_seq 50 | sed "s/^/d_/" | tr "\n" "/" && echo d
Kevin Willford2a1bd452017-03-31 17:32:14 +000021 ) |
Kevin Willford845eec22017-04-03 15:16:42 +000022 sed "s/^/100644 $EMPTY_BLOB /" |
Kevin Willford2a1bd452017-03-31 17:32:14 +000023 git update-index --index-info &&
Nguyễn Thái Ngọc Duy64eb82f2018-03-24 08:44:33 +010024 test-tool lazy-init-name-hash -m
Kevin Willford2a1bd452017-03-31 17:32:14 +000025'
26
27test_done