File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
affinity/src/test/java/net/openhft/affinity Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 31
31
import java .nio .file .Paths ;
32
32
import java .util .ArrayList ;
33
33
import java .util .List ;
34
+ import java .util .BitSet ;
34
35
35
36
import static net .openhft .affinity .AffinityLock .PROCESSORS ;
36
37
import static org .hamcrest .CoreMatchers .is ;
@@ -319,6 +320,16 @@ public void testAffinityLockDescriptions() {
319
320
}
320
321
}
321
322
323
+ @ Test
324
+ public void acquireLockWithoutBindingDoesNotChangeAffinity () {
325
+ BitSet before = (BitSet ) Affinity .getAffinity ().clone ();
326
+ try (AffinityLock lock = AffinityLock .acquireLock (false )) {
327
+ assertFalse (lock .isBound ());
328
+ assertEquals (before , Affinity .getAffinity ());
329
+ }
330
+ assertEquals (before , Affinity .getAffinity ());
331
+ }
332
+
322
333
@ Test (expected = IllegalArgumentException .class )
323
334
public void testTooHighCpuId () {
324
335
AffinityLock .acquireLock (123456 );
You can’t perform that action at this time.
0 commit comments