OSDN Git Service

*** empty log message ***
[lha/lha.git] / tests / lha-test10
1 # -*- shell-script -*-
2 message testing header level 0, 1 and 2
3 $lha c0  test-tmp-h0.lzh test-1
4                                                         check $? $LINENO
5 $lha c1  test-tmp-h1.lzh test-1
6                                                         check $? $LINENO
7 $lha c2  test-tmp-h2.lzh test-1
8                                                         check $? $LINENO
9 $lha xw=test-tmp-h0  test-tmp-h0.lzh
10                                                         check $? $LINENO
11 $lha xw=test-tmp-h1  test-tmp-h1.lzh
12                                                         check $? $LINENO
13 $lha xw=test-tmp-h2  test-tmp-h2.lzh
14                                                         check $? $LINENO
15 $lha vv test-tmp-h0.lzh
16                                                         check $? $LINENO
17 $lha vv test-tmp-h1.lzh
18                                                         check $? $LINENO
19 $lha vv test-tmp-h2.lzh
20                                                         check $? $LINENO
21 $lha vv test-tmp-h0.lzh | grep '\[0\]$'
22                                                         check $? $LINENO
23 $lha vv test-tmp-h1.lzh | grep '\[1\]$'
24                                                         check $? $LINENO
25 $lha vv test-tmp-h2.lzh | grep '\[2\]$'
26                                                         check $? $LINENO
27 diff -r test-1 test-tmp-h0/test-1
28                                                         check $? $LINENO
29 diff -r test-1 test-tmp-h1/test-1
30                                                         check $? $LINENO
31 diff -r test-1 test-tmp-h2/test-1
32                                                         check $? $LINENO
33 mkdir test-tmp-d1 &&
34 cp test-a test-tmp-d1 &&
35 mkdir test-tmp-d1/d2 &&
36 cp test-b test-tmp-d1/d2 &&
37 mkdir test-tmp-d1/d2/d3 &&
38 cp test-c test-tmp-d1/d2/d3 &&
39                                                         check $? $LINENO
40
41 $lha c0  test-tmp2-h0.lzh test-tmp-d1
42                                                         check $? $LINENO
43 $lha c1  test-tmp2-h1.lzh test-tmp-d1
44                                                         check $? $LINENO
45 $lha c2  test-tmp2-h2.lzh test-tmp-d1
46                                                         check $? $LINENO
47 $lha xw=test-tmp2-h0  test-tmp2-h0.lzh
48                                                         check $? $LINENO
49 $lha xw=test-tmp2-h1  test-tmp2-h1.lzh
50                                                         check $? $LINENO
51 $lha xw=test-tmp2-h2  test-tmp2-h2.lzh
52                                                         check $? $LINENO
53 # for logging
54 $lha vv test-tmp2-h0.lzh
55                                                         check $? $LINENO
56 $lha vv test-tmp2-h1.lzh
57                                                         check $? $LINENO
58 $lha vv test-tmp2-h2.lzh
59                                                         check $? $LINENO
60 $lha vv test-tmp2-h0.lzh | grep '\[0\]$'
61                                                         check $? $LINENO
62 $lha vv test-tmp2-h1.lzh | grep '\[1\]$'
63                                                         check $? $LINENO
64 $lha vv test-tmp2-h2.lzh | grep '\[2\]$'
65                                                         check $? $LINENO
66 diff test-a test-tmp2-h0/test-tmp-d1/test-a
67                                                         check $? $LINENO
68 diff test-b test-tmp2-h0/test-tmp-d1/d2/test-b
69                                                         check $? $LINENO
70 diff test-c test-tmp2-h0/test-tmp-d1/d2/d3/test-c
71                                                         check $? $LINENO
72 diff test-a test-tmp2-h1/test-tmp-d1/test-a
73                                                         check $? $LINENO
74 diff test-b test-tmp2-h1/test-tmp-d1/d2/test-b
75                                                         check $? $LINENO
76 diff test-c test-tmp2-h1/test-tmp-d1/d2/d3/test-c
77                                                         check $? $LINENO
78 diff test-a test-tmp2-h2/test-tmp-d1/test-a
79                                                         check $? $LINENO
80 diff test-b test-tmp2-h2/test-tmp-d1/d2/test-b
81                                                         check $? $LINENO
82 diff test-c test-tmp2-h2/test-tmp-d1/d2/d3/test-c
83                                                         check $? $LINENO
84 # long long filename
85 # assume that we are allowed to create 255 bytes filename (not path name).
86 # the _POSIX_PATH_MAX (the maximam length of relative path name) value may
87 # be 255.
88 #
89 # Note that on Cygwin/MinGW, on NTFS, the maximam length of whole path
90 # name (contain the drive letter) seems to be 259.
91 #
92 mkdir test-tmp3
93 case $(uname) in
94 CYGWIN*)
95   # 190 bytes
96   file=1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 ;;
97 *)
98   # 255 bytes
99   file=123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 ;;
100 esac
101 (cd test-tmp3 && touch $file)
102                                                         check $? $LINENO
103 $lha cg  test-tmp3-hg.lzh test-tmp3 2> test-stderr
104                                                         check $? $LINENO
105 # on Cygwin/MinGW, skip this test.
106 # the length of pathname does not amount to the limit of level 0 header.
107 case $(uname) in
108 CYGWIN*) true ;;
109 *) test -s test-stderr ;;
110 esac
111                                                         check $? $LINENO
112 $lha c0  test-tmp3-h0.lzh test-tmp3 2> test-stderr
113                                                         check $? $LINENO
114 # on Cygwin/MinGW, skip this test.
115 # the length of pathname does not amount to the limit of level 0 header.
116 case $(uname) in
117 CYGWIN*) true ;;
118 *) test -s test-stderr ;;
119 esac
120                                                         check $? $LINENO
121 $lha c1  test-tmp3-h1.lzh test-tmp3
122                                                         check $? $LINENO
123 $lha c2  test-tmp3-h2.lzh test-tmp3
124                                                         check $? $LINENO
125 $lha xw=test-tmp3-hg  test-tmp3-hg.lzh
126                                                         check $? $LINENO
127 $lha xw=test-tmp3-h0  test-tmp3-h0.lzh
128                                                         check $? $LINENO
129 $lha xw=test-tmp3-h1  test-tmp3-h1.lzh
130                                                         check $? $LINENO
131 $lha xw=test-tmp3-h2  test-tmp3-h2.lzh
132                                                         check $? $LINENO
133 # for logging
134 $lha vv test-tmp3-hg.lzh
135                                                         check $? $LINENO
136 $lha vv test-tmp3-h0.lzh
137                                                         check $? $LINENO
138 $lha vv test-tmp3-h1.lzh
139                                                         check $? $LINENO
140 $lha vv test-tmp3-h2.lzh
141                                                         check $? $LINENO
142 $lha vv test-tmp3-hg.lzh | grep '\[0\]$'
143                                                         check $? $LINENO
144 $lha vv test-tmp3-h0.lzh | grep '\[0\]$'
145                                                         check $? $LINENO
146 $lha vv test-tmp3-h1.lzh | grep '\[1\]$'
147                                                         check $? $LINENO
148 $lha vv test-tmp3-h2.lzh | grep '\[2\]$'
149                                                         check $? $LINENO
150 test -f test-tmp3-hg/$(echo test-tmp3/$file | cut -c-233)
151                                                         check $? $LINENO
152 test -f test-tmp3-h0/$(echo test-tmp3/$file | cut -c-221)
153                                                         check $? $LINENO
154 test -f test-tmp3-h1/test-tmp3/$file
155                                                         check $? $LINENO
156 test -f test-tmp3-h2/test-tmp3/$file
157                                                         check $? $LINENO
158 # the header size is 0x101 instead of 0x100 on level 2 header
159 file=test-tmp9012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
160 touch $file
161                                                         check $? $LINENO
162 $lha c2 test-tmp4-h2.lzh $file
163                                                         check $? $LINENO
164 $lha vv test-tmp4-h2.lzh
165                                                         check $? $LINENO
166 $lha vv test-tmp4-h2.lzh | grep '\[2\]$'
167                                                         check $? $LINENO
168 $lha xw=test-tmp4 test-tmp4-h2.lzh
169                                                         check $? $LINENO
170 test x"`/bin/ls -l test-tmp4-h2.lzh | awk '{print $5}'`" = x258
171                                                         check $? $LINENO
172 test -f test-tmp4/$file
173                                                         check $? $LINENO