Kevin Willford | 2a1bd45 | 2017-03-31 17:32:14 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='Test the lazy init name hash with various folder structures' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
Nguyễn Thái Ngọc Duy | c033cc1 | 2018-03-24 08:44:48 +0100 | [diff] [blame] | 7 | if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus) |
Kevin Willford | 845eec2 | 2017-04-03 15:16:42 +0000 | [diff] [blame] | 8 | then |
| 9 | skip_all='skipping lazy-init tests, single cpu' |
| 10 | test_done |
| 11 | fi |
| 12 | |
| 13 | LAZY_THREAD_COST=2000 |
| 14 | |
Kevin Willford | 2a1bd45 | 2017-03-31 17:32:14 +0000 | [diff] [blame] | 15 | test_expect_success 'no buffer overflow in lazy_init_name_hash' ' |
| 16 | ( |
Eric Sunshine | 3ea6737 | 2018-07-01 20:23:58 -0400 | [diff] [blame] | 17 | 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 Willford | 2a1bd45 | 2017-03-31 17:32:14 +0000 | [diff] [blame] | 21 | ) | |
Kevin Willford | 845eec2 | 2017-04-03 15:16:42 +0000 | [diff] [blame] | 22 | sed "s/^/100644 $EMPTY_BLOB /" | |
Kevin Willford | 2a1bd45 | 2017-03-31 17:32:14 +0000 | [diff] [blame] | 23 | git update-index --index-info && |
Nguyễn Thái Ngọc Duy | 64eb82f | 2018-03-24 08:44:33 +0100 | [diff] [blame] | 24 | test-tool lazy-init-name-hash -m |
Kevin Willford | 2a1bd45 | 2017-03-31 17:32:14 +0000 | [diff] [blame] | 25 | ' |
| 26 | |
| 27 | test_done |