diff options
author | Samuel Rats <samuel.rats@gmail.com> | 2014-07-25 10:15:38 +0200 |
---|---|---|
committer | Neil Fuller <nfuller@google.com> | 2014-07-28 11:51:42 +0100 |
commit | bf48d2be36b35619309c70dce565d98cc3d17b1b (patch) | |
tree | 0f754739450b90e20a7c08a68794e21a43cda968 /luni/src/main/java/android/util/MutableBoolean.java | |
parent | 7fcc50509264c3a290f26737fd98ed76497f387f (diff) | |
download | libcore-bf48d2be36b35619309c70dce565d98cc3d17b1b.zip libcore-bf48d2be36b35619309c70dce565d98cc3d17b1b.tar.gz libcore-bf48d2be36b35619309c70dce565d98cc3d17b1b.tar.bz2 |
Fix Harmony-707 test for CTS
Change the way Harmony-707 test works.
We cannot check timeouts equality, as timeout is approximated
by the Linux Kernel (see set_sock_timeout() in net/core/sock.c).
Previously, testing with the value provided to setSoTimout()
could fail, depending on the Kernel configuration:
- On a device running a kernel compiled with CONFIG_HZ=100,
it would work
- On a device running a kernel compiled with CONFIG_HZ=250,
it would not:
* Kernel stored a timeout of 3 (3.49975 cast to long)
*timeo_p = tv.tv_sec*HZ + (tv.tv_usec+(1000000/HZ-1))/(1000000/HZ)
with tv.tv_sec=0, tv.tv_usec=10000 (10ms), and HZ=250
* Kernel returned a timeout of 12ms
v.tm.tv_usec = ((sk->sk_rcvtimeo % HZ) * 1000000) / HZ
with sk->sk_rcvtimeo=3 and HZ=250
Instead, we have to ensure that the timeout is not reset to the
internal default timeout after calling accept():
- set a timeout
- immediately retrieve it and store it (this value may differ
from the previously set value)
- call accept()
- retrieve and check the timeout with the previously stored
timeout
Change-Id: I7f05c6843d9e48e6d696dca17173fce028a45a68
Signed-off-by: Samuel Rats <samuel.rats@gmail.com>
Diffstat (limited to 'luni/src/main/java/android/util/MutableBoolean.java')
0 files changed, 0 insertions, 0 deletions