Skip to content

Commit 80f73c2

Browse files
committed
added unit tests for affinity implementations
1 parent 0edb26e commit 80f73c2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/test/java/vanilla/java/affinity/impl/AbstractAffinityImplTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public void getAffinityReturnsValidValue() throws Exception {
2929
);
3030
final int cores = Runtime.getRuntime().availableProcessors();
3131
assertTrue(
32-
"Affinity mask " + affinity + " must be <=(2^cores-1)",
33-
affinity <= ( 1 >> cores )
32+
"Affinity mask " + affinity + " must be <=(2^" + cores + "-1)",
33+
affinity <= ( 1 << cores - 1)
3434
);
3535
}
3636

@@ -44,7 +44,7 @@ public void getAffinityReturnsValuePreviouslySet() throws Exception {
4444
final IAffinityImpl impl = getImpl();
4545
final int cores = Runtime.getRuntime().availableProcessors();
4646
for ( int core = 0; core < cores; core++ ) {
47-
final long mask = ( 1 >> core );
47+
final long mask = ( 1 << core );
4848
getAffinityReturnsValuePreviouslySet( impl, mask );
4949
}
5050
}

0 commit comments

Comments
 (0)