@@ -14,6 +14,10 @@ import Darwin
14
14
import Glibc
15
15
#endif
16
16
17
+ func operationCount( _ n: Int ) -> Int {
18
+ return _isDebugAssertConfiguration ( ) ? n/ 2 : n
19
+ }
20
+
17
21
final class HeapBool {
18
22
var value : Bool
19
23
init ( _ value: Bool ) {
@@ -792,47 +796,47 @@ struct AtomicInitializeARCRefRaceTest : RaceTestWithPerTrialData {
792
796
var AtomicIntTestSuite = TestSuite ( " AtomicInt " )
793
797
794
798
AtomicIntTestSuite . test ( " fetchAndAdd/1 " ) {
795
- runRaceTest ( AtomicInt_fetchAndAdd_1_RaceTest . self, operations: 6400 )
799
+ runRaceTest ( AtomicInt_fetchAndAdd_1_RaceTest . self, operations: operationCount ( 6400 ) )
796
800
}
797
801
798
802
AtomicIntTestSuite . test ( " fetchAndAdd/ReleaseAtomicStores/1 " ) {
799
803
runRaceTest (
800
804
AtomicInt_fetchAndAdd_ReleaseAtomicStores_1_RaceTest . self,
801
- operations: 12800 )
805
+ operations: operationCount ( 12800 ) )
802
806
}
803
807
804
808
AtomicIntTestSuite . test ( " fetchAndAdd/ReleaseAtomicStores/2 " ) {
805
809
runRaceTest (
806
810
AtomicInt_fetchAndAdd_ReleaseAtomicStores_2_RaceTest . self,
807
- operations: 12800 )
811
+ operations: operationCount ( 12800 ) )
808
812
}
809
813
810
814
AtomicIntTestSuite . test ( " fetchAndAdd/ReleaseNonAtomicStores/1 " ) {
811
815
runRaceTest (
812
816
AtomicInt_fetchAndAdd_ReleaseNonAtomicStores_RaceTest . self,
813
- operations: 25600 )
817
+ operations: operationCount ( 25600 ) )
814
818
}
815
819
816
820
AtomicIntTestSuite . test ( " fetchAndAnd/1 " ) {
817
- runRaceTest ( AtomicInt_fetchAndAnd_1_RaceTest . self, operations: 6400 )
821
+ runRaceTest ( AtomicInt_fetchAndAnd_1_RaceTest . self, operations: operationCount ( 6400 ) )
818
822
}
819
823
// FIXME: add more tests for fetchAndAnd, like we have for fetchAndAdd.
820
824
821
825
AtomicIntTestSuite . test ( " fetchAndOr/1 " ) {
822
- runRaceTest ( AtomicInt_fetchAndOr_1_RaceTest . self, operations: 6400 )
826
+ runRaceTest ( AtomicInt_fetchAndOr_1_RaceTest . self, operations: operationCount ( 6400 ) )
823
827
}
824
828
// FIXME: add more tests for fetchAndOr, like we have for fetchAndAdd.
825
829
826
830
AtomicIntTestSuite . test ( " fetchAndXor/1 " ) {
827
- runRaceTest ( AtomicInt_fetchAndXor_1_RaceTest . self, operations: 6400 )
831
+ runRaceTest ( AtomicInt_fetchAndXor_1_RaceTest . self, operations: operationCount ( 6400 ) )
828
832
}
829
833
// FIXME: add more tests for fetchAndXor, like we have for fetchAndAdd.
830
834
831
835
832
836
var AtomicARCRefTestSuite = TestSuite ( " AtomicARCRef " )
833
837
834
838
AtomicARCRefTestSuite . test ( " initialize,load " ) {
835
- runRaceTest ( AtomicInitializeARCRefRaceTest . self, operations: 25600 )
839
+ runRaceTest ( AtomicInitializeARCRefRaceTest . self, operations: operationCount ( 25600 ) )
836
840
expectEqual ( 0 , dummyObjectCount. getSum ( ) )
837
841
}
838
842
0 commit comments