@@ -68,9 +68,12 @@ test_parse_load_options(char *load_option_data,
68
68
assert_false_goto (EFI_ERROR (status ), err , "\n" );
69
69
70
70
assert_nonzero_goto (second_stage , err , "\n" );
71
- assert_not_equal_goto (second_stage , dummy_second_stage , err , "%p == %p\n" );
72
- assert_zero_goto (StrnCmp (second_stage , target_second_stage , 90 ),
73
- err_print_second_stage , "%d != 0\n" );
71
+ if (target_second_stage ) {
72
+ assert_not_equal_goto (second_stage , dummy_second_stage , err , "%p == %p\n" );
73
+ assert_zero_goto (StrnCmp (second_stage , target_second_stage , 90 ),
74
+ err_print_second_stage , "%d != 0\n" );
75
+ } else
76
+ assert_equal_goto (second_stage , dummy_second_stage , err , "%p != %p\n" );
74
77
75
78
assert_equal_goto (load_options_size , target_remaining_size , err_remaining , "%zu != %zu\n" );
76
79
assert_equal_goto (load_options , target_remaining , err_remaining , "%p != %p\n" );
@@ -255,6 +258,73 @@ test_bds_2(void)
255
258
target_remaining_size );
256
259
}
257
260
261
+ int
262
+ test_multi_end_dp (void )
263
+ {
264
+ /*
265
+ 00000000 01 00 00 00 d0 00 4f 00 6e 00 62 00 6f 00 61 00 |......O.n.b.o.a.|
266
+ 00000010 72 00 64 00 20 00 4e 00 49 00 43 00 28 00 49 00 |r.d. .N.I.C.(.I.|
267
+ 00000020 50 00 56 00 34 00 29 00 00 00 02 01 0c 00 d0 41 |P.V.4.)........A|
268
+ 00000030 03 0a 00 00 00 00 01 01 06 00 06 1f 03 0b 25 00 |..............%.|
269
+ 00000040 2c ea 7f 0a 9f 69 00 00 00 00 00 00 00 00 00 00 |,....i..........|
270
+ 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
271
+ 00000060 00 03 0c 1b 00 00 00 00 00 00 00 00 00 00 00 00 |................|
272
+ 00000070 00 00 00 00 00 00 00 00 00 00 00 00 7f ff 04 00 |................|
273
+ 00000080 01 04 76 00 ef 47 64 2d c9 3b a0 41 ac 19 4d 51 |..v..Gd-.;.A..MQ|
274
+ 00000090 d0 1b 4c e6 50 00 58 00 45 00 20 00 49 00 50 00 |..L.P.X.E. .I.P.|
275
+ 000000a0 34 00 20 00 49 00 6e 00 74 00 65 00 6c 00 28 00 |4. .I.n.t.e.l.(.|
276
+ 000000b0 52 00 29 00 20 00 45 00 74 00 68 00 65 00 72 00 |R.). .E.t.h.e.r.|
277
+ 000000c0 6e 00 65 00 74 00 20 00 43 00 6f 00 6e 00 6e 00 |n.e.t. .C.o.n.n.|
278
+ 000000d0 65 00 63 00 74 00 69 00 6f 00 6e 00 20 00 28 00 |e.c.t.i.o.n. .(.|
279
+ 000000e0 36 00 29 00 20 00 49 00 32 00 31 00 39 00 2d 00 |6.). .I.2.1.9.-.|
280
+ 000000f0 4c 00 4d 00 00 00 7f ff 04 00 00 00 42 4f |L.M.........BO|
281
+ */
282
+ char load_option_data [] = {
283
+ 0x01 , 0x00 , 0x00 , 0x00 , 0xd0 , 0x00 , 0x4f , 0x00 ,
284
+ 0x6e , 0x00 , 0x62 , 0x00 , 0x6f , 0x00 , 0x61 , 0x00 ,
285
+ 0x72 , 0x00 , 0x64 , 0x00 , 0x20 , 0x00 , 0x4e , 0x00 ,
286
+ 0x49 , 0x00 , 0x43 , 0x00 , 0x28 , 0x00 , 0x49 , 0x00 ,
287
+ 0x50 , 0x00 , 0x56 , 0x00 , 0x34 , 0x00 , 0x29 , 0x00 ,
288
+ 0x00 , 0x00 , 0x02 , 0x01 , 0x0c , 0x00 , 0xd0 , 0x41 ,
289
+ 0x03 , 0x0a , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x01 ,
290
+ 0x06 , 0x00 , 0x06 , 0x1f , 0x03 , 0x0b , 0x25 , 0x00 ,
291
+ 0x2c , 0xea , 0x7f , 0x0a , 0x9f , 0x69 , 0x00 , 0x00 ,
292
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
293
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
294
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
295
+ 0x00 , 0x03 , 0x0c , 0x1b , 0x00 , 0x00 , 0x00 , 0x00 ,
296
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
297
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
298
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x7f , 0xff , 0x04 , 0x00 ,
299
+ 0x01 , 0x04 , 0x76 , 0x00 , 0xef , 0x47 , 0x64 , 0x2d ,
300
+ 0xc9 , 0x3b , 0xa0 , 0x41 , 0xac , 0x19 , 0x4d , 0x51 ,
301
+ 0xd0 , 0x1b , 0x4c , 0xe6 , 0x50 , 0x00 , 0x58 , 0x00 ,
302
+ 0x45 , 0x00 , 0x20 , 0x00 , 0x49 , 0x00 , 0x50 , 0x00 ,
303
+ 0x34 , 0x00 , 0x20 , 0x00 , 0x49 , 0x00 , 0x6e , 0x00 ,
304
+ 0x74 , 0x00 , 0x65 , 0x00 , 0x6c , 0x00 , 0x28 , 0x00 ,
305
+ 0x52 , 0x00 , 0x29 , 0x00 , 0x20 , 0x00 , 0x45 , 0x00 ,
306
+ 0x74 , 0x00 , 0x68 , 0x00 , 0x65 , 0x00 , 0x72 , 0x00 ,
307
+ 0x6e , 0x00 , 0x65 , 0x00 , 0x74 , 0x00 , 0x20 , 0x00 ,
308
+ 0x43 , 0x00 , 0x6f , 0x00 , 0x6e , 0x00 , 0x6e , 0x00 ,
309
+ 0x65 , 0x00 , 0x63 , 0x00 , 0x74 , 0x00 , 0x69 , 0x00 ,
310
+ 0x6f , 0x00 , 0x6e , 0x00 , 0x20 , 0x00 , 0x28 , 0x00 ,
311
+ 0x36 , 0x00 , 0x29 , 0x00 , 0x20 , 0x00 , 0x49 , 0x00 ,
312
+ 0x32 , 0x00 , 0x31 , 0x00 , 0x39 , 0x00 , 0x2d , 0x00 ,
313
+ 0x4c , 0x00 , 0x4d , 0x00 , 0x00 , 0x00 , 0x7f , 0xff ,
314
+ 0x04 , 0x00 , 0x00 , 0x00 , 0x42 , 0x4f
315
+ };
316
+ size_t load_option_data_size = sizeof (load_option_data );
317
+ char * target_remaining = & load_option_data [load_option_data_size - 2 ];
318
+ size_t target_remaining_size = 2 ;
319
+
320
+ return test_parse_load_options (load_option_data ,
321
+ load_option_data_size ,
322
+ "test.efi" ,
323
+ NULL ,
324
+ target_remaining ,
325
+ target_remaining_size );
326
+ }
327
+
258
328
int
259
329
main (void )
260
330
{
@@ -263,6 +333,7 @@ main(void)
263
333
test (test_bds_0 );
264
334
test (test_bds_1 );
265
335
test (test_bds_2 );
336
+ test (test_multi_end_dp );
266
337
return status ;
267
338
}
268
339
0 commit comments