@@ -79,11 +79,6 @@ public static IEnumerable<object[]> GetNullAndEmptyArrays() =>
79
79
*/
80
80
} ;
81
81
82
- private const int NoParallelismThreadCount = 1 ;
83
- private const int DefaultParallelismThreadCount = int . MaxValue ;
84
-
85
- private int GetParallelismThreadCount ( bool isUseSingleThreadedCopy ) => isUseSingleThreadedCopy ? NoParallelismThreadCount : DefaultParallelismThreadCount ;
86
-
87
82
/// <summary>
88
83
/// Temporarily save off the value of MSBUILDALWAYSOVERWRITEREADONLYFILES, so that we can run
89
84
/// the tests isolated from the current state of the environment, but put it back how it belongs
@@ -509,7 +504,7 @@ public void DontCopyOverSameFile(bool isUseHardLinks, bool isUseSymbolicLinks, b
509
504
UseSymboliclinksIfPossible = isUseSymbolicLinks ,
510
505
} ;
511
506
512
- t . Execute ( m . CopyFile , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
507
+ t . Execute ( m . CopyFile , ! isUseSingleThreadedCopy ) ;
513
508
514
509
// Expect for there to have been no copies.
515
510
Assert . Equal ( 0 , m . copyCount ) ;
@@ -557,7 +552,7 @@ public void QuestionCopyFile(bool isUseHardLinks, bool isUseSymbolicLinks, bool
557
552
FailIfNotIncremental = true ,
558
553
} ;
559
554
560
- Assert . False ( t . Execute ( m . CopyFile , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ) ;
555
+ Assert . False ( t . Execute ( m . CopyFile , ! isUseSingleThreadedCopy ) ) ;
561
556
562
557
// Expect for there to have been no copies.
563
558
Assert . Equal ( 0 , m . copyCount ) ;
@@ -617,7 +612,7 @@ public void QuestionCopyFileSameContent(bool isUseHardLinks, bool isUseSymbolicL
617
612
SkipUnchangedFiles = true ,
618
613
FailIfNotIncremental = true ,
619
614
} ;
620
- Assert . True ( t . Execute ( m . CopyFile , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ) ;
615
+ Assert . True ( t . Execute ( m . CopyFile , ! isUseSingleThreadedCopy ) ) ;
621
616
622
617
// Expect for there to have been no copies.
623
618
Assert . Equal ( 0 , m . copyCount ) ;
@@ -670,7 +665,7 @@ public void QuestionCopyFileNotSameContent(bool isUseHardLinks, bool isUseSymbol
670
665
FailIfNotIncremental = true ,
671
666
} ;
672
667
673
- Assert . False ( t . Execute ( m . CopyFile , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ) ;
668
+ Assert . False ( t . Execute ( m . CopyFile , ! isUseSingleThreadedCopy ) ) ;
674
669
675
670
// Expect for there to have been no copies.
676
671
Assert . Equal ( 0 , m . copyCount ) ;
@@ -2015,7 +2010,7 @@ public void CopyWithDuplicatesUsingFolder(bool isUseHardLinks, bool isUseSymboli
2015
2010
filesActuallyCopied . Add ( new KeyValuePair < FileState , FileState > ( source , dest ) ) ;
2016
2011
}
2017
2012
return true ;
2018
- } , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2013
+ } , ! isUseSingleThreadedCopy ) ;
2019
2014
2020
2015
Assert . True ( success ) ;
2021
2016
Assert . Equal ( 2 , filesActuallyCopied . Count ) ;
@@ -2082,7 +2077,7 @@ public void CopyWithDuplicatesUsingFiles(bool isUseHardLinks, bool isUseSymbolic
2082
2077
filesActuallyCopied . Add ( new KeyValuePair < FileState , FileState > ( source , dest ) ) ;
2083
2078
}
2084
2079
return true ;
2085
- } , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2080
+ } , ! isUseSingleThreadedCopy ) ;
2086
2081
2087
2082
Assert . True ( success ) ;
2088
2083
Assert . Equal ( 4 , filesActuallyCopied . Count ) ;
@@ -2352,7 +2347,7 @@ public void FailureWithNoRetries(bool isUseHardLinks, bool isUseSymbolicLinks, b
2352
2347
} ;
2353
2348
2354
2349
var copyFunctor = new CopyFunctor ( 2 , false /* do not throw on failure */ ) ;
2355
- bool result = t . Execute ( copyFunctor . Copy , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2350
+ bool result = t . Execute ( copyFunctor . Copy , ! isUseSingleThreadedCopy ) ;
2356
2351
2357
2352
Assert . False ( result ) ;
2358
2353
engine . AssertLogDoesntContain ( "MSB3026" ) ;
@@ -2419,7 +2414,7 @@ public void SuccessAfterOneRetry(bool isUseHardLinks, bool isUseSymbolicLinks, b
2419
2414
} ;
2420
2415
2421
2416
var copyFunctor = new CopyFunctor ( 2 , false /* do not throw on failure */ ) ;
2422
- bool result = t . Execute ( copyFunctor . Copy , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2417
+ bool result = t . Execute ( copyFunctor . Copy , ! isUseSingleThreadedCopy ) ;
2423
2418
2424
2419
Assert . True ( result ) ;
2425
2420
engine . AssertLogContains ( "MSB3026" ) ;
@@ -2446,7 +2441,7 @@ public void SuccessAfterOneRetryContinueToNextFile(bool isUseHardLinks, bool isU
2446
2441
} ;
2447
2442
2448
2443
var copyFunctor = new CopyFunctor ( 2 , false /* do not throw on failure */ ) ;
2449
- bool result = t . Execute ( copyFunctor . Copy , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2444
+ bool result = t . Execute ( copyFunctor . Copy , ! isUseSingleThreadedCopy ) ;
2450
2445
2451
2446
Assert . True ( result ) ;
2452
2447
engine . AssertLogContains ( "MSB3026" ) ;
@@ -2478,7 +2473,7 @@ public void TooFewRetriesReturnsFalse(bool isUseHardLinks, bool isUseSymbolicLin
2478
2473
} ;
2479
2474
2480
2475
var copyFunctor = new CopyFunctor ( 4 , false /* do not throw */ ) ;
2481
- bool result = t . Execute ( copyFunctor . Copy , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2476
+ bool result = t . Execute ( copyFunctor . Copy , ! isUseSingleThreadedCopy ) ;
2482
2477
2483
2478
Assert . False ( result ) ;
2484
2479
engine . AssertLogContains ( "MSB3026" ) ;
@@ -2507,7 +2502,7 @@ public void TooFewRetriesThrows(bool isUseHardLinks, bool isUseSymbolicLinks, bo
2507
2502
} ;
2508
2503
2509
2504
var copyFunctor = new CopyFunctor ( 3 , true /* throw */ ) ;
2510
- bool result = t . Execute ( copyFunctor . Copy , GetParallelismThreadCount ( isUseSingleThreadedCopy ) ) ;
2505
+ bool result = t . Execute ( copyFunctor . Copy , ! isUseSingleThreadedCopy ) ;
2511
2506
2512
2507
Assert . False ( result ) ;
2513
2508
engine . AssertLogContains ( "MSB3026" ) ;
0 commit comments