aboutsummaryrefslogtreecommitdiff
path: root/tests/sys_mman_test.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2015-11-19 13:44:20 -0800
committerJosh Gao <jmgao@google.com>2015-11-19 13:44:20 -0800
commit2feb9dde6090a4b88d0cadc0a69245beeb173468 (patch)
tree71135ccb2317fb72438b16a1ef7d08389232b8ab /tests/sys_mman_test.cpp
parentc22a7de798c4c0da30ad095a0c61a8f905eb9613 (diff)
downloadbionic-2feb9dde6090a4b88d0cadc0a69245beeb173468.tar.gz
Fix test build break.
Change-Id: I73a39c6d4bb9baebbfb5572e9259bcd405116039
Diffstat (limited to 'tests/sys_mman_test.cpp')
-rw-r--r--tests/sys_mman_test.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/sys_mman_test.cpp b/tests/sys_mman_test.cpp
index a71eb25c2..ddb6c77a5 100644
--- a/tests/sys_mman_test.cpp
+++ b/tests/sys_mman_test.cpp
@@ -17,6 +17,7 @@
#include <gtest/gtest.h>
#include <sys/mman.h>
+#include <sys/user.h>
#include <sys/types.h>
#include <unistd.h>
@@ -220,7 +221,7 @@ TEST(sys_mman, mremap) {
ASSERT_EQ(MAP_FAILED, mremap(nullptr, 0, 0, 0));
}
-const size_t huge = PTRDIFF_MAX + 1;
+const size_t huge = size_t(PTRDIFF_MAX) + 1;
TEST(sys_mman, mmap_PTRDIFF_MAX) {
ASSERT_EQ(MAP_FAILED, mmap(nullptr, huge, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0));