From 2cf2b2d7b9011a32cf69a8cb5b38ba1a4ace1fae Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 19 Jan 2025 09:41:49 +0000 Subject: [PATCH] Make tests run in a more reasonable time --- Tests/base/NSFastEnumeration/basic.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tests/base/NSFastEnumeration/basic.m b/Tests/base/NSFastEnumeration/basic.m index 8430681e8..a2e9e0e3d 100644 --- a/Tests/base/NSFastEnumeration/basic.m +++ b/Tests/base/NSFastEnumeration/basic.m @@ -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]) { @@ -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]) { @@ -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]]; }