|
@@ -368,16 +368,28 @@ static void list_test_exec ( void ) {
|
368
|
368
|
ok ( list_entry ( &list_tests[3].list, struct list_test, list )
|
369
|
369
|
== &list_tests[3] );
|
370
|
370
|
|
371
|
|
- /* Test list_first_entry() */
|
|
371
|
+ /* Test list_first_entry() and list_last_entry() */
|
372
|
372
|
INIT_LIST_HEAD ( list );
|
373
|
373
|
list_add_tail ( &list_tests[9].list, list );
|
374
|
374
|
list_add_tail ( &list_tests[5].list, list );
|
375
|
375
|
list_add_tail ( &list_tests[6].list, list );
|
376
|
376
|
ok ( list_first_entry ( list, struct list_test, list )
|
377
|
377
|
== &list_tests[9] );
|
|
378
|
+ ok ( list_last_entry ( list, struct list_test, list )
|
|
379
|
+ == &list_tests[6] );
|
378
|
380
|
list_del ( &list_tests[9].list );
|
379
|
381
|
ok ( list_first_entry ( list, struct list_test, list )
|
380
|
382
|
== &list_tests[5] );
|
|
383
|
+ ok ( list_last_entry ( list, struct list_test, list )
|
|
384
|
+ == &list_tests[6] );
|
|
385
|
+ list_del ( &list_tests[6].list );
|
|
386
|
+ ok ( list_first_entry ( list, struct list_test, list )
|
|
387
|
+ == &list_tests[5] );
|
|
388
|
+ ok ( list_last_entry ( list, struct list_test, list )
|
|
389
|
+ == &list_tests[5] );
|
|
390
|
+ list_del ( &list_tests[5].list );
|
|
391
|
+ ok ( list_first_entry ( list, struct list_test, list ) == NULL );
|
|
392
|
+ ok ( list_last_entry ( list, struct list_test, list ) == NULL );
|
381
|
393
|
|
382
|
394
|
/* Test list_for_each() */
|
383
|
395
|
INIT_LIST_HEAD ( list );
|