Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
apangin committed Jul 25, 2021
1 parent 0f0ef33 commit e5864f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/one/nio/net/JavaDatagramSocketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class JavaDatagramSocketTest {
@Test
public void testConnectedSocket() throws IOException {
DatagramChannel jdkChannel = DatagramChannel.open();
jdkChannel.bind(new InetSocketAddress(InetAddress.getLocalHost(), 0));
jdkChannel.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
jdkChannel.socket().setSoTimeout(1000);

JavaDatagramSocket oneSocket = new JavaDatagramSocket();
Expand Down
3 changes: 2 additions & 1 deletion test/one/nio/os/bpf/BpfMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.LongBuffer;

import org.junit.Test;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void testPerCpuMap() throws IOException {
assert map.totalValueSize == 8 * BpfMap.CPUS;
assert map.get(BpfMap.bytes(1)) == null;

ByteBuffer buf = ByteBuffer.allocate(map.totalValueSize);
ByteBuffer buf = ByteBuffer.allocate(map.totalValueSize).order(ByteOrder.nativeOrder());
LongBuffer lbuf = buf.asLongBuffer();
for (int i = 0; i < BpfMap.CPUS; i++) {
lbuf.put(i);
Expand Down

0 comments on commit e5864f7

Please sign in to comment.