From 36363b0d43f12432837ab936b85973f08e74a299 Mon Sep 17 00:00:00 2001 From: zhulin0910 Date: Thu, 24 Sep 2015 14:21:45 +0800 Subject: Fix time calculation in test_SSLSession_getLastAccessedTime [root cause] Time precision in NativeCrypto SSL_SESSION_get_time is second, ignore millisecond. Then, assertTrue( Math.abs(s.server.getLastAccessedTime() - s.client.getLastAccessedTime()) < 1 * 1000); is not rigorous. [changes] modify diff time of s.server.getLastAccessedTime() and s.client.getLastAccessedTime() <= 1*1000 Bug: https://code.google.com/p/android/issues/detail?id=183898 (cherry picked from commit 3f49882b1d3316e37d8312d707c29261d14ece65) Change-Id: Ib0d5eb512f717f1fd88818eac5bf8ef0e5cbac6b --- luni/src/test/java/libcore/javax/net/ssl/SSLSessionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLSessionTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLSessionTest.java index a434d94..bc2b626 100644 --- a/luni/src/test/java/libcore/javax/net/ssl/SSLSessionTest.java +++ b/luni/src/test/java/libcore/javax/net/ssl/SSLSessionTest.java @@ -99,7 +99,7 @@ public class SSLSessionTest extends TestCase { assertTrue("s.server.getLastAccessedTime()=" + s.server.getLastAccessedTime() + " " + "s.client.getLastAccessedTime()=" + s.client.getLastAccessedTime(), Math.abs(s.server.getLastAccessedTime() - - s.client.getLastAccessedTime()) < 1 * 1000); + - s.client.getLastAccessedTime()) <= 1 * 1000); assertTrue(s.server.getLastAccessedTime() >= s.server.getCreationTime()); assertTrue(s.client.getLastAccessedTime() >= -- cgit v1.1