File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ void equeue_destroy(equeue_t *q)
114
114
}
115
115
}
116
116
if (es -> dtor ) {
117
- es -> dtor (es + 1 );
117
+ es -> dtor (es + 1 );
118
118
}
119
119
}
120
120
// notify background timer
Original file line number Diff line number Diff line change @@ -779,6 +779,29 @@ void break_request_cleared_on_timeout(void)
779
779
equeue_destroy (& q );
780
780
}
781
781
782
+ void sibling_test (void )
783
+ {
784
+ equeue_t q ;
785
+ int err = equeue_create (& q , 1024 );
786
+ test_assert (!err );
787
+
788
+ int id0 = equeue_call_in (& q , 1 , pass_func , 0 );
789
+ int id1 = equeue_call_in (& q , 1 , pass_func , 0 );
790
+ int id2 = equeue_call_in (& q , 1 , pass_func , 0 );
791
+
792
+ struct equeue_event * e = q .queue ;
793
+
794
+ for (; e ; e = e -> next ) {
795
+ for (struct equeue_event * s = e -> sibling ; s ; s = s -> sibling ) {
796
+ test_assert (!s -> next );
797
+ }
798
+ }
799
+ equeue_cancel (& q , id0 );
800
+ equeue_cancel (& q , id1 );
801
+ equeue_cancel (& q , id2 );
802
+ equeue_destroy (& q );
803
+ }
804
+
782
805
int main ()
783
806
{
784
807
printf ("beginning tests...\n" );
@@ -806,7 +829,7 @@ int main()
806
829
test_run (fragmenting_barrage_test , 20 );
807
830
test_run (multithreaded_barrage_test , 20 );
808
831
test_run (break_request_cleared_on_timeout );
809
-
832
+ test_run ( sibling_test );
810
833
printf ("done!\n" );
811
834
return test_failure ;
812
835
}
You can’t perform that action at this time.
0 commit comments