[NaCl SDK] nacl_io: Fix check of nanoseconds in Utimes test
commit9a28a05d2570e3aef568790f6aa018987e19eb00
authorbinji <binji@chromium.org>
Thu, 4 Dec 2014 22:46:16 +0000 (4 14:46 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 4 Dec 2014 22:46:54 +0000 (4 22:46 +0000)
tree1f4012b0d5af77f95308a3bf8109b8e714ea59c9
parent6ec55ee6530ba8f62119d3bae37ea61790fd7fb3
[NaCl SDK] nacl_io: Fix check of nanoseconds in Utimes test

The previous code was checking to make sure the seconds and nanoseconds values
are both greater than or equal to the same values from a time in the past. This
is not true when the nanoseconds value wraps around, so a more complex check is
required.

See a failure here:
http://build.chromium.org/p/client.nacl.sdk/builders/linux-sdk-multi/builds/9092/steps/standalone%20test%3A%20nacl_io_test/logs/stdio

    [ RUN      ] KernelProxyTest.Utimes
    kernel_proxy_test.cc:618: Failure
    Expected: (buf.st_atim.tv_nsec) >= (tm.tv_usec * 1000), actual: 6000 vs 999998000
    kernel_proxy_test.cc:620: Failure
    Expected: (buf.st_mtim.tv_nsec) >= (tm.tv_usec * 1000), actual: 6000 vs 999998000

BUG=none
R=sbc@chromium.org

Review URL: https://codereview.chromium.org/748913004

Cr-Commit-Position: refs/heads/master@{#306915}
native_client_sdk/src/tests/nacl_io_test/kernel_proxy_test.cc