Debian Codegraph @

src/Programs/valtest.tar

raw
1 README0000644000175000001440000000053210307201247010434 0ustar jrhusersThis directory contains a test implementation of a test suite for
2 CIF validity. The idea is that all tests are provided as CIF
3 files, with (at least) two blocks; one block contains one or
4 more invalid items relative to a DDL dictionary of
5 test item names; and the other block contains a list of what
6 the validaty checking program should output.
7 type_test.cif0000644000175000001440000000136510307222361012264 0ustar jrhusers#CIF1.1
8 # A CIF file for validity testing. One block contains a series of
9 # invalidly-typed items as per the supplied DDL1 dictionary file
10 # The other block contains a report which any validity checking
11 # program should be able to produce on request.
12
13 data_invalid_type_block
14 _test_reference_block_id invalid_type_block
15 _test_construct_character 'there is nothing wrong with this'
16 # this data item should be a number
17 _test_construct_number 453K
18 # there is no time type in DDL1 or 2
19 _test_construct_time 15:34
20
21 data_invalid_type_block_report
22 _test_result_block_id invalid_type_block
23 _test_result_validity invalid
24 _test_result_fail_item_name '_test_number'
25 _test_result_fail_type 'Non-number format number'
26 _test_result_fail_item_value 453K
27 validity_test.dic0000644000175000001440000001554710307524633013144 0ustar jrhusers# A DDL1 dictionary file for validity checking. The item names
28 # defined here are used for two purposes; one set of names are
29 # used in constructing valid/invalid blocks to be tested, and
30 # the other set is used to construct a test report block. A
31 # program is considered to correctly validate a CIF if it is
32 # able to produce an equivalent report CIF block to that contained
33 # together with the incorrectly constructed block
34
35 data_on_this_dictionary
36
37 _dictionary_name cif_validity_test.dic
38 _dictionary_version 0.1
39 _dictionary_update 2005-09-07
40 _dictionary_history
41
42 ;
43 2005-09-07 Initial draft J.R. Hester
44 ;
45
46 data_test_reference_[test]
47 _name '_test_reference_[test]'
48 _category category_overview
49 _type null
50 _definition
51 ; Items in this category are used to describe the
52 background of the validity test, and to link the
53 test block with the report block.
54 ;
55
56 data_test_reference_block_id
57 _name '_test_reference_block_id'
58 _category test_reference
59 _type char
60 _list no
61 _definition
62 ; This id is used to link the block to be tested for
63 validity with the report block. It should therefore
64 be unique within the space of invalid blocks for checking.
65 ;
66
67 data_test_reference_history
68 _name '_test_reference_history'
69 _category test_reference
70 _type char
71 _list both
72 _definition 'Description of changes to the test block'
73
74 data_test_reference_background
75 _name '_test_reference_background'
76 _category test_reference
77 _type char
78 _list no
79 _definition
80 ; A description of the motivation for a test and the logic
81 behind the construction of the invalid test block.
82 ;
83
84 data_test_construct_[test]
85 _name '_test_contruct_[test]'
86 _category category_overview
87 _type null
88 _definition
89 ; _test_construct contains item names which can be used in
90 constructing simple tests. Validity checking software
91 should be able to validate against the definitions in
92 this category and produce a report conforming to the
93 definitions in the _test_report category
94 ;
95
96 data_test_construct_character
97 _name '_test_construct_character'
98 _category test_construct
99 _type char
100 _list both
101 _definition
102 ; A character type data item. There seems to be no way to
103 construct a non-conformant item in a syntactically correct
104 CIF.
105 ;
106
107 data_test_construct_number
108 _name '_test_construct_number'
109 _category test_construct
110 _type numb
111 _list both
112 _type_conditions none
113 _definition
114 ; A plain number with no esd appended
115 ;
116
117 data_test_construct_number_esd
118 _name '_test_construct_number_esd'
119 _category test_construct
120 _type numb
121 _list both
122 _type_conditions esd
123 _definition
124 ; A plain number with or without esd appended
125 ;
126
127 data_test_construct_enumeration
128 _name '_test_construct_enumeration'
129 _category test_construct
130 _type char
131 _list both
132 loop_
133 _enumeration
134 _enumeration_detail
135 ABC 'first letters'
136 123 'first numbers'
137 'do re mi' 'first notes'
138 'Jan Feb' 'first months'
139 _definition
140 ; An enumerated data item
141 ;
142
143 data_test_construct_type_construct
144 _name '_test_construct_type_construct'
145 _category test_construct
146 _type numb
147 _type_construct '( *-?[0-9]+)'
148 _list both
149 _definition
150 ; An item with an explicit type construct, in this case
151 cribbed from the MS dictionary. We may need to add a
152 number of these for comprehensive testing.
153 ;
154
155 data_test_construct_enumeration_range
156 _name '_test_construct_enumeration_range'
157 _category test_construct
158 _type char
159 _list both
160 _enumeration_range -2:11.7
161 _definition
162 ; A data item with a specified range
163 ;
164
165 data_test_result_[test]
166 _name '_test_result_[test]'
167 _category category_overview
168 _type null
169 _definition
170 ; Items in this category describe the results of validity
171 tests. A conformant validity checking program should use
172 these items to produce a CIF block identical to that
173 provided with the invalid test block.
174 ;
175
176 data_test_result_block_id
177 _name '_test_result_block_id'
178 _category test_result
179 _type char
180 _definition
181 ; This id should be identical to the _test_reference_block_id
182 of the invalid CIF block to which this test result corresponds.
183 ;
184
185 data_test_result_validity
186 _name '_test_result_validity'
187 _category test_result
188 _type char
189 loop_
190 _enumeration
191 _enumeration_detail
192 valid 'No invalid items or structures found'
193 invalid 'One or more invalid items or structures present'
194 _definition
195 ; This item describes whether or not the validity checking
196 program found any errors in the test block
197 ;
198
199 data_test_result_missing_name
200 _name '_test_result_missing_name'
201 _category test_result
202 _type char
203 _list both
204 _definition
205 ; A list of item names which were not found in the dictionary.
206 Note that item names which are not present in the dictionary
207 do not invalidate a data block.
208 ;
209
210 data_test_result_fail_item_name
211 _name '_test_result_fail_item_name'
212 _category test_result
213 _type char
214 _list both
215 _definition
216 ; The name of a data item which has an invalid value or is
217 incorrectly placed in the data block
218 ;
219
220 data_test_result_fail_item_value
221 _name '_test_result_fail_item_value'
222 _category test_result
223 _type char
224 _list both
225 _definition
226 ; If the validity error relates to an item value, the value
227 of the invalid item
228 ;
229
230 data_test_result_fail_type
231 _name '_test_result_fail_type'
232 _category test_result
233 _type char
234 _list both
235 loop_
236 _enumeration
237 _enumeration_detail
238 'Value construction'
239 ; The value does not conform to the
240 construction specified in the
241 dictionary or DDL1 file
242 ;
243 'Value range' 'Value outside specified range'
244 'Value enumeration' 'Value not in enumeration set'
245 'Esd appended' 'Esd appended when not allowed'
246
247