Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/diff/tests/diff_test.sh
| Show First 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | bigu_body() | ||||
| echo $'x\nb\ny' >b | echo $'x\nb\ny' >b | ||||
| atf_check -s exit:2 -e ignore diff -U$(((1<<31)-1)) a b | atf_check -s exit:2 -e ignore diff -U$(((1<<31)-1)) a b | ||||
| atf_check -s exit:1 -o match:'^@@ -1,3 \+1,3 @@$' \ | atf_check -s exit:1 -o match:'^@@ -1,3 \+1,3 @@$' \ | ||||
| diff -U$(((1<<31)-2)) a b | diff -U$(((1<<31)-2)) a b | ||||
| atf_check -s exit:1 -o match:'^@@ -1,3 \+1,3 @@$' \ | atf_check -s exit:1 -o match:'^@@ -1,3 \+1,3 @@$' \ | ||||
| diff -Astone -U$(((1<<31)-2)) a b | 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_init_test_cases() | ||||
| { | { | ||||
| atf_add_test_case simple | atf_add_test_case simple | ||||
| atf_add_test_case unified | atf_add_test_case unified | ||||
| atf_add_test_case header | atf_add_test_case header | ||||
| atf_add_test_case header_ns | atf_add_test_case header_ns | ||||
| atf_add_test_case ifdef | atf_add_test_case ifdef | ||||
| atf_add_test_case group_format | atf_add_test_case group_format | ||||
| Show All 13 Lines | atf_init_test_cases() | ||||
| atf_add_test_case non_regular_file | atf_add_test_case non_regular_file | ||||
| atf_add_test_case binary | atf_add_test_case binary | ||||
| atf_add_test_case functionname | atf_add_test_case functionname | ||||
| atf_add_test_case noderef | atf_add_test_case noderef | ||||
| atf_add_test_case ignorecase | atf_add_test_case ignorecase | ||||
| atf_add_test_case dirloop | atf_add_test_case dirloop | ||||
| atf_add_test_case bigc | atf_add_test_case bigc | ||||
| atf_add_test_case bigu | atf_add_test_case bigu | ||||
| atf_add_test_case prleak | |||||
| } | } | ||||