sd: remove 'ssd' driver support
[unleashed/tickless.git] / usr / src / lib / libshell / common / tests / sun_solaris_vartree003.sh
blob834234a44c7092dceb7b2e2f8321429f7070b167
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
27 # variable tree test #003
28 # Propose of this test is whether ksh93 handles global variable trees
29 # and function-local variable trees the same way, including "nameref"
30 # and "unset" handling.
33 # test setup
34 function err_exit
36 print -u2 -n "\t"
37 print -u2 -r ${Command}[$1]: "${@:2}"
38 (( Errors < 127 && Errors++ ))
40 alias err_exit='err_exit $LINENO'
42 # the test cannot use "nounset"
43 Command=${0##*/}
44 integer Errors=0
46 function example_tree
48 cat <<EOF
50 typeset -A l1=(
51 [adobe]=(
52 typeset -A l2=(
53 [avantgarde]=(
54 typeset -A l3=(
55 [demi]=(
56 typeset -A entries=(
57 [182c069a485316b1bc7ae001c04c7835]=(
58 typeset -a comments=(
59 FONT
60 -adobe-avantgarde-demi-r-normal--199-120-1200-1200-p-1130-iso8859-1
61 COPYRIGHT
62 'Copyright Notice not available'
63 RAW_PIXELSIZE
64 RAW_POINTSIZE
66 section
67 diaeresis
68 copyright
69 ordfeminine
70 guillemotleft
72 typeset -a filenames=(
73 X11Rx/R6.4/xc/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/AvantGarde-Demi.pmf
75 md5sum=182c069a485316b1bc7ae001c04c7835
76 typeset -a xlfd=(
77 -adobe-avantgarde-demi-r-normal--199-120-1200-1200-p-1130-iso8859-1
80 [7db15b51965d8fe1f1c55fcb101d7616]=(
81 typeset -a comments=(
82 FONT
83 -adobe-avantgarde-demi-i-normal--199-120-1200-1200-p-1130-iso8859-1
84 COPYRIGHT
85 'Copyright Notice not available'
86 RAW_PIXELSIZE
87 RAW_POINTSIZE
89 section
90 diaeresis
91 copyright
92 ordfeminine
93 guillemotleft
95 typeset -a filenames=(
96 X11Rx/R6.4/xc/programs/Xserver/XpConfig/C/print/models/SPSPARC2/fonts/AvantGarde-DemiOblique.pmf
98 md5sum=7db15b51965d8fe1f1c55fcb101d7616
99 typeset -a xlfd=(
100 -adobe-avantgarde-demi-i-normal--199-120-1200-1200-p-1130-iso8859-1
103 [a37e4a4a5035abf6f294d830fbd9e775]=(
104 typeset -a comments=(
105 FONT
106 -adobe-avantgarde-demi-r-normal--422-120-2540-2540-p-2395-iso8859-1
107 COPYRIGHT
108 'Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.'
109 RAW_PIXELSIZE
110 RAW_POINTSIZE
112 section
113 diaeresis
114 copyright
115 ordfeminine
116 guillemotleft
118 typeset -a filenames=(
119 fox-gate/XW_NV/open-src/tarballs/xorg-server-1.3.0.0/hw/xprint/config/C/print/models/PSdefault/fonts/AvantGarde-Demi.pmf
121 md5sum=a37e4a4a5035abf6f294d830fbd9e775
122 typeset -a xlfd=(
123 -adobe-avantgarde-demi-r-normal--422-120-2540-2540-p-2395-iso8859-1
126 [da3d6d94fcf759b95c7f829ce5619374]=(
127 typeset -a comments=(
128 FONT
129 -adobe-avantgarde-demi-i-normal--422-120-2540-2540-p-2395-iso8859-1
130 COPYRIGHT
131 'Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.'
132 RAW_PIXELSIZE
133 RAW_POINTSIZE
135 section
136 diaeresis
137 copyright
138 ordfeminine
139 guillemotleft
141 typeset -a filenames=(
142 fox-gate/XW_NV/open-src/tarballs/xorg-server-1.3.0.0/hw/xprint/config/C/print/models/PSdefault/fonts/AvantGarde-DemiOblique.pmf
144 md5sum=da3d6d94fcf759b95c7f829ce5619374
145 typeset -a xlfd=(
146 -adobe-avantgarde-demi-i-normal--422-120-2540-2540-p-2395-iso8859-1
160 function main
162 set -o errexit
164 typeset xlfd_tree=()
165 typeset -A xlfd_tree.l1
167 eval "xlfd_tree=$( example_tree )"
169 typeset i j k l fn
171 # filter chain begin
172 for i in "${!xlfd_tree.l1[@]}" ; do
173 for j in "${!xlfd_tree.l1["$i"].l2[@]}" ; do
174 for k in "${!xlfd_tree.l1["$i"].l2["$j"].l3[@]}" ; do
175 nameref vndnode=xlfd_tree.l1["$i"].l2["$j"].l3["$k"]
177 for l in "${!vndnode.entries[@]}" ; do
178 nameref node=vndnode.entries["$l"]
180 for fn in "${node.filenames[@]}" ; do
181 if [[ "${fn}" != ~(E)x-re_gate_XW_NV_MWS ]] ; then
182 unset "${!node}"
183 break
185 done
186 done
187 done
188 done
189 done
191 # filter chain end
193 return 0
196 main || ((Errors++))
198 # tests done
199 exit $((Errors))