Don't depend on timing (different machines vary hugely) for pass/fail.

This commit is contained in:
rfm 2025-01-15 09:29:54 +00:00
parent 479cccebe8
commit 5926e58091
2 changed files with 3 additions and 2 deletions

View file

@ -158,7 +158,7 @@ int main()
}
}
PASS((ran == want), "many operations, all were performed")
PASS((f - s) < 0.5, "concurrent test duration")
NSLog(@"Duration for %d concurrent operations %g seconds.", want, (f - s));
// multiple concurrent operations
[q setMaxConcurrentOperationCount: 5];

View file

@ -59,7 +59,8 @@ int main()
[q waitUntilAllOperationsAreFinished];
f = [NSDate timeIntervalSinceReferenceDate];
PASS([o counter] == want, "expected number of operations")
PASS((f - s) < 0.5, "sequential test duration")
NSLog(@"Duration for %d sequential operations %g seconds.", want, (f - s));
[o reset];
[q addOperationWithTarget: o