aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-02-05 14:39:47 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-02-05 14:39:47 +0000
commit270492602b9bd8b8fce4f021f055804978bf3f23 (patch)
tree8a9c070361362bd421458069f3e219640cdffbfe /usr.bin/diff
parent5fc739eb5949620da911db2f87ca8faedc549d3a (diff)
Diffstat (limited to 'usr.bin/diff')
-rwxr-xr-xusr.bin/diff/tests/diff_test.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/usr.bin/diff/tests/diff_test.sh b/usr.bin/diff/tests/diff_test.sh
index 89348d3a8b16..a3f76602cf37 100755
--- a/usr.bin/diff/tests/diff_test.sh
+++ b/usr.bin/diff/tests/diff_test.sh
@@ -411,6 +411,27 @@ bigu_body()
diff -Astone -U$(((1<<31)-2)) a b
}
+prleak_head()
+{
+ atf_set "descr" "Verify that pagination does not leak resources"
+}
+prleak_body()
+{
+ local n=32
+ mkdir a b
+ for hi in $(jot -w%02x $n 0) ; do
+ mkdir a/$hi b/$hi
+ for lo in $(jot -w%02x $n 0) ; do
+ echo "$hi$lo" >a/$hi/$lo
+ echo "$hi$lo" >b/$hi/$lo
+ done
+ done
+ ulimit -n 1000
+ ulimit -u 1000
+ atf_check diff -rul a b
+ atf_check diff -Astone -rul a b
+}
+
atf_init_test_cases()
{
atf_add_test_case simple
@@ -440,4 +461,5 @@ atf_init_test_cases()
atf_add_test_case dirloop
atf_add_test_case bigc
atf_add_test_case bigu
+ atf_add_test_case prleak
}