Fix KeepalivePacketDataUtilTest crash on eng build am: 8f260383f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164999 Change-Id: I64c9bd2da7cbfd6d6c254287309e0738201c336f
This commit is contained in:
@@ -24,7 +24,9 @@ import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.net.util.KeepalivePacketDataUtil;
|
||||
import android.util.Log;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -38,8 +40,19 @@ public final class KeepalivePacketDataUtilTest {
|
||||
private static final byte[] IPV4_KEEPALIVE_SRC_ADDR = {10, 0, 0, 1};
|
||||
private static final byte[] IPV4_KEEPALIVE_DST_ADDR = {10, 0, 0, 5};
|
||||
|
||||
private Log.TerribleFailureHandler mOriginalHandler;
|
||||
|
||||
@Before
|
||||
public void setUp() {}
|
||||
public void setUp() {
|
||||
// Terrible failures are logged when using deprecated methods on newer platforms
|
||||
mOriginalHandler = Log.setWtfHandler((tag, what, sys) ->
|
||||
Log.e(tag, "Terrible failure in test", what));
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
Log.setWtfHandler(mOriginalHandler);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFromTcpKeepaliveStableParcelable() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user