OSDN Git Service

b52823d0b88cb92cc050693fa09e4cfe969b11c0
[lha/lha.git] / tests / lha-test11
1 # -*- shell-script -*-
2 FILENAME=lha-test11
3 message testing the long filename support
4 # long long filename
5 # assume that we are allowed to create 255 bytes filename (not path name).
6 # the _POSIX_PATH_MAX (the maximam length of relative path name) value may
7 # be 255.
8 #
9 # Note that on Cygwin/MinGW, on NTFS, the maximam length of whole path
10 # name (contain the drive letter) is limited probably. it seems to be 259 (?)
11 #
12 mkdir test-tmp1
13 case $(uname) in
14 CYGWIN*)
15   # 190 bytes
16   file=1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 ;;
17 *)
18   # 255 bytes
19   file=123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 ;;
20 esac
21 (cd test-tmp1 && touch $file)
22                                                         check $? $LINENO
23 $lha cg  test-tmp1-hg.lzh test-tmp1 2> test-stderr
24                                                         check $? $LINENO
25 # on Cygwin/MinGW, skip this test.
26 # the length of pathname does not amount to the limit of level 0 header.
27 case $(uname) in
28 CYGWIN*) true ;;
29 *) test -s test-stderr ;;
30 esac
31                                                         check $? $LINENO
32 $lha c0  test-tmp1-h0.lzh test-tmp1 2> test-stderr
33                                                         check $? $LINENO
34 # on Cygwin/MinGW, skip this test.
35 # the length of pathname does not amount to the limit of level 0 header.
36 case $(uname) in
37 CYGWIN*) true ;;
38 *) test -s test-stderr ;;
39 esac
40                                                         check $? $LINENO
41 $lha c1  test-tmp1-h1.lzh test-tmp1
42                                                         check $? $LINENO
43 $lha c2  test-tmp1-h2.lzh test-tmp1
44                                                         check $? $LINENO
45 $lha xw=test-tmp1-hg  test-tmp1-hg.lzh
46                                                         check $? $LINENO
47 $lha xw=test-tmp1-h0  test-tmp1-h0.lzh
48                                                         check $? $LINENO
49 $lha xw=test-tmp1-h1  test-tmp1-h1.lzh
50                                                         check $? $LINENO
51 $lha xw=test-tmp1-h2  test-tmp1-h2.lzh
52                                                         check $? $LINENO
53 # for logging
54 $lha vv test-tmp1-hg.lzh
55                                                         check $? $LINENO
56 $lha vv test-tmp1-h0.lzh
57                                                         check $? $LINENO
58 $lha vv test-tmp1-h1.lzh
59                                                         check $? $LINENO
60 $lha vv test-tmp1-h2.lzh
61                                                         check $? $LINENO
62 $lha vv test-tmp1-hg.lzh | egrep '\[0\].?$'
63                                                         check $? $LINENO
64 $lha vv test-tmp1-h0.lzh | egrep '\[0\].?$'
65                                                         check $? $LINENO
66 $lha vv test-tmp1-h1.lzh | egrep '\[1\].?$'
67                                                         check $? $LINENO
68 $lha vv test-tmp1-h2.lzh | egrep '\[2\].?$'
69                                                         check $? $LINENO
70 test -f test-tmp1-hg/$(echo test-tmp1/$file | cut -c-233)
71                                                         check $? $LINENO
72 test -f test-tmp1-h0/$(echo test-tmp1/$file | cut -c-221)
73                                                         check $? $LINENO
74 test -f test-tmp1-h1/test-tmp1/$file
75                                                         check $? $LINENO
76 test -f test-tmp1-h2/test-tmp1/$file
77                                                         check $? $LINENO
78 # the header size is 0x101 instead of 0x100 on level 2 header
79 file=test-tmp9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
80 touch $file
81                                                         check $? $LINENO
82 $lha c2 test-tmp4-h2.lzh $file
83                                                         check $? $LINENO
84 $lha vv test-tmp4-h2.lzh
85                                                         check $? $LINENO
86 $lha vv test-tmp4-h2.lzh | egrep '\[2\].?$'
87                                                         check $? $LINENO
88 $lha xw=test-tmp4 test-tmp4-h2.lzh
89                                                         check $? $LINENO
90 test x"`/bin/ls -l test-tmp4-h2.lzh | awk '{print $5}'`" = x258
91                                                         check $? $LINENO
92 test -f test-tmp4/$file
93                                                         check $? $LINENO