|
@@ -419,6 +419,27 @@ static void list_test_exec ( void ) {
|
419
|
419
|
ok ( list_prev_entry ( &list_tests[1], list, list ) == &list_tests[5] );
|
420
|
420
|
ok ( list_next_entry ( &list_tests[1], list, list ) == NULL );
|
421
|
421
|
|
|
422
|
+ /* Test list_is_first_entry() and list_is_last_entry() */
|
|
423
|
+ INIT_LIST_HEAD ( list );
|
|
424
|
+ list_add_tail ( &list_tests[4].list, list );
|
|
425
|
+ list_add_tail ( &list_tests[8].list, list );
|
|
426
|
+ list_add_tail ( &list_tests[3].list, list );
|
|
427
|
+ list_add_tail ( &list_tests[6].list, list );
|
|
428
|
+ ok ( list_is_first_entry ( &list_tests[4], list, list ) );
|
|
429
|
+ ok ( ! list_is_first_entry ( &list_tests[8], list, list ) );
|
|
430
|
+ ok ( ! list_is_first_entry ( &list_tests[3], list, list ) );
|
|
431
|
+ ok ( ! list_is_first_entry ( &list_tests[6], list, list ) );
|
|
432
|
+ ok ( ! list_is_last_entry ( &list_tests[4], list, list ) );
|
|
433
|
+ ok ( ! list_is_last_entry ( &list_tests[8], list, list ) );
|
|
434
|
+ ok ( ! list_is_last_entry ( &list_tests[3], list, list ) );
|
|
435
|
+ ok ( list_is_last_entry ( &list_tests[6], list, list ) );
|
|
436
|
+ list_del ( &list_tests[4].list );
|
|
437
|
+ ok ( list_is_first_entry ( &list_tests[8], list, list ) );
|
|
438
|
+ list_del ( &list_tests[8].list );
|
|
439
|
+ list_del ( &list_tests[6].list );
|
|
440
|
+ ok ( list_is_first_entry ( &list_tests[3], list, list ) );
|
|
441
|
+ ok ( list_is_last_entry ( &list_tests[3], list, list ) );
|
|
442
|
+
|
422
|
443
|
/* Test list_for_each() */
|
423
|
444
|
INIT_LIST_HEAD ( list );
|
424
|
445
|
list_add_tail ( &list_tests[6].list, list );
|