|
70 | 70 | ),
|
71 | 71 | pytest.param(
|
72 | 72 | # Type section size incomplete
|
73 |
| - bytes.fromhex("ef00010100"), |
| 73 | + Container(raw_bytes=bytes.fromhex("ef00010100")), |
74 | 74 | [EOFException.INCOMPLETE_SECTION_SIZE, EOFException.INVALID_TYPE_SECTION_SIZE],
|
75 | 75 | id="EOF1I3540_0011_type_section_size_incomplete",
|
76 | 76 | ),
|
|
101 | 101 | ),
|
102 | 102 | pytest.param(
|
103 | 103 | # No data section after code section size
|
104 |
| - bytes.fromhex("ef00010100040200010001"), |
| 104 | + Container(raw_bytes=bytes.fromhex("ef00010100040200010001")), |
105 | 105 | EOFException.MISSING_HEADERS_TERMINATOR,
|
106 | 106 | id="EOF1I3540_0017_no_data_section_after_code_section_size",
|
107 | 107 | ),
|
108 | 108 | pytest.param(
|
109 | 109 | # No data size
|
110 |
| - bytes.fromhex("ef0001010004020001000104"), |
| 110 | + Container(raw_bytes=bytes.fromhex("ef0001010004020001000104")), |
111 | 111 | [EOFException.MISSING_HEADERS_TERMINATOR, EOFException.INCOMPLETE_DATA_HEADER],
|
112 | 112 | id="EOF1I3540_0018_no_data_size",
|
113 | 113 | ),
|
114 | 114 | pytest.param(
|
115 | 115 | # Data size incomplete
|
116 |
| - bytes.fromhex("ef000101000402000100010400"), |
| 116 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010400")), |
117 | 117 | [EOFException.INCOMPLETE_SECTION_SIZE, EOFException.INCOMPLETE_DATA_HEADER],
|
118 | 118 | id="EOF1I3540_0019_data_size_incomplete",
|
119 | 119 | ),
|
120 | 120 | pytest.param(
|
121 | 121 | # No section terminator after data section size
|
122 |
| - bytes.fromhex("ef00010100040200010001040002"), |
| 122 | + Container(raw_bytes=bytes.fromhex("ef00010100040200010001040002")), |
123 | 123 | EOFException.MISSING_HEADERS_TERMINATOR,
|
124 | 124 | id="EOF1I3540_0020_no_section_terminator_after_data_section_size",
|
125 | 125 | ),
|
126 | 126 | pytest.param(
|
127 | 127 | # No type section contents
|
128 |
| - bytes.fromhex("ef0001010004020001000104000200"), |
| 128 | + Container(raw_bytes=bytes.fromhex("ef0001010004020001000104000200")), |
129 | 129 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
130 | 130 | id="EOF1I3540_0021_no_type_section_contents",
|
131 | 131 | ),
|
132 | 132 | pytest.param(
|
133 | 133 | # Type section contents (no outputs and max stack)
|
134 |
| - bytes.fromhex("ef000101000402000100010400020000"), |
| 134 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010400020000")), |
135 | 135 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
136 | 136 | id="EOF1I3540_0022_invalid_type_section_no_outputs_and_max_stack",
|
137 | 137 | ),
|
138 | 138 | pytest.param(
|
139 | 139 | # Type section contents (no max stack)
|
140 |
| - bytes.fromhex("ef00010100040200010001040002000000"), |
| 140 | + Container(raw_bytes=bytes.fromhex("ef00010100040200010001040002000000")), |
141 | 141 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
142 | 142 | id="EOF1I3540_0023_invalid_type_section_no_max_stack",
|
143 | 143 | ),
|
144 | 144 | pytest.param(
|
145 | 145 | # Type section contents (max stack incomplete)
|
146 |
| - bytes.fromhex("ef0001010004020001000104000200000000"), |
| 146 | + Container(raw_bytes=bytes.fromhex("ef0001010004020001000104000200000000")), |
147 | 147 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
148 | 148 | id="EOF1I3540_0024_invalid_type_section_max_stack_incomplete",
|
149 | 149 | ),
|
150 | 150 | pytest.param(
|
151 | 151 | # No code section contents
|
152 |
| - bytes.fromhex("ef000101000402000100010400020000000000"), |
| 152 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010400020000000000")), |
153 | 153 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
154 | 154 | id="EOF1I3540_0025_no_code_section_contents",
|
155 | 155 | ),
|
156 | 156 | pytest.param(
|
157 | 157 | # Code section contents incomplete
|
158 |
| - bytes.fromhex("ef0001010004020001002904000000000000027f"), |
| 158 | + Container(raw_bytes=bytes.fromhex("ef0001010004020001002904000000000000027f")), |
159 | 159 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
160 | 160 | id="EOF1I3540_0026_code_section_contents_incomplete",
|
161 | 161 | ),
|
162 | 162 | pytest.param(
|
163 | 163 | # Trailing bytes after code section
|
164 |
| - bytes.fromhex("ef0001 010004 0200010001 040000 00 00800000 fe aabbcc"), |
| 164 | + Container( |
| 165 | + raw_bytes=bytes.fromhex("ef0001 010004 0200010001 040000 00 00800000 fe aabbcc") |
| 166 | + ), |
165 | 167 | EOFException.INVALID_SECTION_BODIES_SIZE,
|
166 | 168 | id="EOF1I3540_0027_trailing_bytes_after_code_section",
|
167 | 169 | ),
|
168 | 170 | pytest.param(
|
169 | 171 | # Trailing bytes after code section with wrong first section type
|
170 |
| - bytes.fromhex("ef0001 010004 0200010001 040000 00 00000000 fe aabbcc"), |
| 172 | + Container( |
| 173 | + raw_bytes=bytes.fromhex("ef0001 010004 0200010001 040000 00 00000000 fe aabbcc") |
| 174 | + ), |
171 | 175 | EOFException.INVALID_FIRST_SECTION_TYPE,
|
172 | 176 | id="EOF1I3540_0027_trailing_bytes_after_code_section_with_wrong_first_section_type",
|
173 | 177 | ),
|
174 | 178 | pytest.param(
|
175 | 179 | # Empty code section
|
176 |
| - bytes.fromhex("ef000101000402000100000400000000000000"), |
| 180 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100000400000000000000")), |
177 | 181 | EOFException.ZERO_SECTION_SIZE,
|
178 | 182 | id="EOF1I3540_0028_empty_code_section",
|
179 | 183 | ),
|
180 | 184 | pytest.param(
|
181 | 185 | # Code section preceding type section
|
182 |
| - bytes.fromhex("ef000102000100010100040400020000000000feaabb"), |
| 186 | + Container(raw_bytes=bytes.fromhex("ef000102000100010100040400020000000000feaabb")), |
183 | 187 | [EOFException.MISSING_TYPE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
184 | 188 | id="EOF1I3540_0030_code_section_preceding_type_section",
|
185 | 189 | ),
|
186 | 190 | pytest.param(
|
187 | 191 | # Data section preceding type section
|
188 |
| - bytes.fromhex("ef000104000201000402000100010000000000feaabb"), |
| 192 | + Container(raw_bytes=bytes.fromhex("ef000104000201000402000100010000000000feaabb")), |
189 | 193 | [EOFException.MISSING_TYPE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
190 | 194 | id="EOF1I3540_0031_data_section_preceding_type_section",
|
191 | 195 | ),
|
192 | 196 | pytest.param(
|
193 | 197 | # Data section preceding code section
|
194 |
| - bytes.fromhex("ef000101000404000202000100010000000000feaabb"), |
| 198 | + Container(raw_bytes=bytes.fromhex("ef000101000404000202000100010000000000feaabb")), |
195 | 199 | [EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
196 | 200 | id="EOF1I3540_0032_data_section_preceding_code_section",
|
197 | 201 | ),
|
198 | 202 | pytest.param(
|
199 | 203 | # Data section without code section
|
200 |
| - bytes.fromhex("ef00010100040400020000000000aabb"), |
| 204 | + Container(raw_bytes=bytes.fromhex("ef00010100040400020000000000aabb")), |
201 | 205 | [EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
202 | 206 | id="EOF1I3540_0033_data_section_without_code_section",
|
203 | 207 | ),
|
204 | 208 | pytest.param(
|
205 | 209 | # No data section
|
206 |
| - bytes.fromhex("ef000101000402000100010000000000fe"), |
| 210 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010000000000fe")), |
207 | 211 | [EOFException.MISSING_DATA_SECTION, EOFException.UNEXPECTED_HEADER_KIND],
|
208 | 212 | id="EOF1I3540_0034_no_data_section",
|
209 | 213 | ),
|
|
222 | 226 | ),
|
223 | 227 | pytest.param(
|
224 | 228 | # Trailing bytes after data section with wrong first section type
|
225 |
| - bytes.fromhex("ef0001 010004 0200010001 040002 00 00000000 fe aabbccdd"), |
| 229 | + Container( |
| 230 | + raw_bytes=bytes.fromhex("ef0001 010004 0200010001 040002 00 00000000 fe aabbccdd") |
| 231 | + ), |
226 | 232 | EOFException.INVALID_FIRST_SECTION_TYPE,
|
227 | 233 | id="EOF1I3540_0035_trailing_bytes_after_data_section_with_wrong_first_section_type",
|
228 | 234 | ),
|
229 | 235 | pytest.param(
|
230 | 236 | # Multiple data sections
|
231 |
| - bytes.fromhex("ef000101000402000100010400020400020000000000feaabbaabb"), |
| 237 | + Container( |
| 238 | + raw_bytes=bytes.fromhex("ef000101000402000100010400020400020000000000feaabbaabb") |
| 239 | + ), |
232 | 240 | [EOFException.MISSING_TERMINATOR, EOFException.UNEXPECTED_HEADER_KIND],
|
233 | 241 | id="EOF1I3540_0036_multiple_data_sections",
|
234 | 242 | ),
|
235 | 243 | pytest.param(
|
236 | 244 | # Multiple code and data sections
|
237 |
| - bytes.fromhex("ef000101000802000200010001040002040002000000000000000000fefeaabbaabb"), |
| 245 | + Container( |
| 246 | + raw_bytes=bytes.fromhex( |
| 247 | + "ef000101000802000200010001040002040002000000000000000000fefeaabbaabb" |
| 248 | + ) |
| 249 | + ), |
238 | 250 | [EOFException.MISSING_TERMINATOR, EOFException.UNEXPECTED_HEADER_KIND],
|
239 | 251 | id="EOF1I3540_0037_multiple_code_and_data_sections",
|
240 | 252 | ),
|
241 | 253 | pytest.param(
|
242 | 254 | # Unknown section ID (at the beginning)
|
243 |
| - bytes.fromhex("ef000105000101000402000100010400000000000000fe"), |
| 255 | + Container(raw_bytes=bytes.fromhex("ef000105000101000402000100010400000000000000fe")), |
244 | 256 | [EOFException.MISSING_TYPE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
245 | 257 | id="EOF1I3540_0038_unknown_section_id_at_the_beginning_05",
|
246 | 258 | ),
|
247 | 259 | pytest.param(
|
248 | 260 | # Unknown section ID (at the beginning)
|
249 |
| - bytes.fromhex("ef000106000101000402000100010400000000000000fe"), |
| 261 | + Container(raw_bytes=bytes.fromhex("ef000106000101000402000100010400000000000000fe")), |
250 | 262 | [EOFException.MISSING_TYPE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
251 | 263 | id="EOF1I3540_0039_unknown_section_id_at_the_beginning_06",
|
252 | 264 | ),
|
253 | 265 | pytest.param(
|
254 | 266 | # Unknown section ID (at the beginning)
|
255 |
| - bytes.fromhex("ef0001ff000101000402000100010400000000000000fe"), |
| 267 | + Container(raw_bytes=bytes.fromhex("ef0001ff000101000402000100010400000000000000fe")), |
256 | 268 | [EOFException.MISSING_TYPE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
257 | 269 | id="EOF1I3540_0040_unknown_section_id_at_the_beginning_ff",
|
258 | 270 | ),
|
259 | 271 | pytest.param(
|
260 | 272 | # Unknown section ID (after types section)
|
261 |
| - bytes.fromhex("ef000101000405000102000100010400000000000000fe"), |
| 273 | + Container(raw_bytes=bytes.fromhex("ef000101000405000102000100010400000000000000fe")), |
262 | 274 | [EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
263 | 275 | id="EOF1I3540_0041_unknown_section_id_after_types_section_05",
|
264 | 276 | ),
|
265 | 277 | pytest.param(
|
266 | 278 | # Unknown section ID (after types section)
|
267 |
| - bytes.fromhex("ef000101000406000102000100010400000000000000fe"), |
| 279 | + Container(raw_bytes=bytes.fromhex("ef000101000406000102000100010400000000000000fe")), |
268 | 280 | [EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
269 | 281 | id="EOF1I3540_0042_unknown_section_id_after_types_section_06",
|
270 | 282 | ),
|
271 | 283 | pytest.param(
|
272 | 284 | # Unknown section ID (after types section)
|
273 |
| - bytes.fromhex("ef0001010004ff000102000100010400000000000000fe"), |
| 285 | + Container(raw_bytes=bytes.fromhex("ef0001010004ff000102000100010400000000000000fe")), |
274 | 286 | [EOFException.MISSING_CODE_HEADER, EOFException.UNEXPECTED_HEADER_KIND],
|
275 | 287 | id="EOF1I3540_0043_unknown_section_id_after_types_section_ff",
|
276 | 288 | ),
|
277 | 289 | pytest.param(
|
278 | 290 | # Unknown section ID (after code section)
|
279 |
| - bytes.fromhex("ef000101000402000100010500010400000000000000fe"), |
| 291 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010500010400000000000000fe")), |
280 | 292 | [EOFException.MISSING_DATA_SECTION, EOFException.UNEXPECTED_HEADER_KIND],
|
281 | 293 | id="EOF1I3540_0044_unknown_section_id_after_code_section_05",
|
282 | 294 | ),
|
283 | 295 | pytest.param(
|
284 | 296 | # Unknown section ID (after code section)
|
285 |
| - bytes.fromhex("ef000101000402000100010600010400000000000000fe"), |
| 297 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010600010400000000000000fe")), |
286 | 298 | [EOFException.MISSING_DATA_SECTION, EOFException.UNEXPECTED_HEADER_KIND],
|
287 | 299 | id="EOF1I3540_0045_unknown_section_id_after_code_section_06",
|
288 | 300 | ),
|
289 | 301 | pytest.param(
|
290 | 302 | # Unknown section ID (after code section)
|
291 |
| - bytes.fromhex("ef00010100040200010001ff00010400000000000000fe"), |
| 303 | + Container(raw_bytes=bytes.fromhex("ef00010100040200010001ff00010400000000000000fe")), |
292 | 304 | [EOFException.MISSING_DATA_SECTION, EOFException.UNEXPECTED_HEADER_KIND],
|
293 | 305 | id="EOF1I3540_0046_unknown_section_id_after_code_section_ff",
|
294 | 306 | ),
|
295 | 307 | pytest.param(
|
296 | 308 | # Unknown section ID (after data section)
|
297 |
| - bytes.fromhex("ef000101000402000100010400000500010000000000fe"), |
| 309 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010400000500010000000000fe")), |
298 | 310 | [EOFException.MISSING_TERMINATOR, EOFException.UNEXPECTED_HEADER_KIND],
|
299 | 311 | id="EOF1I3540_0047_unknown_section_id_after_data_section_05",
|
300 | 312 | ),
|
301 | 313 | pytest.param(
|
302 | 314 | # Unknown section ID (after data section)
|
303 |
| - bytes.fromhex("ef000101000402000100010400000600010000000000fe"), |
| 315 | + Container(raw_bytes=bytes.fromhex("ef000101000402000100010400000600010000000000fe")), |
304 | 316 | [EOFException.MISSING_TERMINATOR, EOFException.UNEXPECTED_HEADER_KIND],
|
305 | 317 | id="EOF1I3540_0048_unknown_section_id_after_data_section_06",
|
306 | 318 | ),
|
307 | 319 | pytest.param(
|
308 | 320 | # Unknown section ID (after data section)
|
309 |
| - bytes.fromhex("ef00010100040200010001040000ff00010000000000fe"), |
| 321 | + Container(raw_bytes=bytes.fromhex("ef00010100040200010001040000ff00010000000000fe")), |
310 | 322 | [EOFException.MISSING_TERMINATOR, EOFException.UNEXPECTED_HEADER_KIND],
|
311 | 323 | id="EOF1I3540_0049_unknown_section_id_after_data_section_ff",
|
312 | 324 | ),
|
|
0 commit comments