@@ -143,6 +143,7 @@ test_group_notify2(long cycle, dispatch_group_t tested)
143
143
dispatch_group_async (group , q , ^{
144
144
// Seems to trigger a little more reliably with some work being
145
145
// done in this block
146
+ assert (cycle && "cycle must be non-zero" );
146
147
eh = (float )sin (M_1_PI / cycle );
147
148
});
148
149
}
@@ -171,9 +172,9 @@ test_group_notify(void *ctxt __attribute__((unused)))
171
172
dispatch_group_t tested = dispatch_group_create ();
172
173
test_ptr_notnull ("dispatch_group_create" , tested );
173
174
long i ;
174
- for (i = 0 ; i < LOOP_COUNT ; i ++ ) {
175
- if (!(( i + 1 ) % (LOOP_COUNT /10 ))) {
176
- fprintf (stderr , "#%ld\n" , i + 1 );
175
+ for (i = 1 ; i <= LOOP_COUNT ; i ++ ) {
176
+ if (!(i % (LOOP_COUNT /10 ))) {
177
+ fprintf (stderr , "#%ld\n" , i );
177
178
}
178
179
dispatch_group_enter (tested );
179
180
test_group_notify2 (i , tested );
@@ -182,7 +183,7 @@ test_group_notify(void *ctxt __attribute__((unused)))
182
183
break ;
183
184
}
184
185
}
185
- test_long ("dispatch_group_notify" , i , LOOP_COUNT );
186
+ test_long ("dispatch_group_notify" , i - 1 , LOOP_COUNT );
186
187
test_stop ();
187
188
}
188
189
0 commit comments