Skip to content

Commit

Permalink
Make tests run in a more reasonable time
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Jan 19, 2025
1 parent c225efa commit 2cf2b2d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Tests/base/NSFastEnumeration/basic.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ - (void) removeObject: (id)anObject
void fast_enumeration_mutation_add(id mutableCollection)
{
NSUInteger i = 0;
NSUInteger c = [mutableCollection count]/2;

FOR_IN(id, o, mutableCollection)
if (i == [mutableCollection count]/2)
if (i == c)
{
if ([mutableCollection respondsToSelector: set])
{
Expand All @@ -48,9 +49,10 @@ void fast_enumeration_mutation_add(id mutableCollection)
void fast_enumeration_mutation_remove(id mutableCollection)
{
NSUInteger i = 0;
NSUInteger c = [mutableCollection count]/2;

FOR_IN(id, o, mutableCollection)
if (i == [mutableCollection count]/2)
if (i == c)
{
if ([mutableCollection respondsToSelector: key])
{
Expand Down Expand Up @@ -113,7 +115,7 @@ int main()
set = @selector(setObject:forKey:);
key = @selector(removeObjectForKey:);

for (i = 0; i < 10000; i++)
for (i = 0; i < 1000; i++)
{
[objects addObject: [NSString stringWithFormat: @"%.4d", i]];
}
Expand Down

0 comments on commit 2cf2b2d

Please sign in to comment.