summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/mmap.cc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-01-21 16:32:49 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-21 16:32:49 -0800
commit45a8edbd5ae6c836317923dc7d2b5baac9feea98 (patch)
treec8e011c89c1808fe2e520ee41c9bcb2af7911cd0 /test/syscalls/linux/mmap.cc
parentb3405a719cbb33dac2deced192209a5584e5e3d6 (diff)
parent200cf245c4ed43d8e2a37484cdbc36f5fbfa1ac9 (diff)
Merge pull request #1492 from majek:err_typo_in_netstack_tests
PiperOrigin-RevId: 290840370
Diffstat (limited to 'test/syscalls/linux/mmap.cc')
-rw-r--r--test/syscalls/linux/mmap.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/syscalls/linux/mmap.cc b/test/syscalls/linux/mmap.cc
index 1c4d9f1c7..9b2270c8d 100644
--- a/test/syscalls/linux/mmap.cc
+++ b/test/syscalls/linux/mmap.cc
@@ -50,13 +50,13 @@ namespace testing {
namespace {
-PosixErrorOr<int64_t> VirtualMemorySize() {
+PosixErrorOr<int64> VirtualMemorySize() {
ASSIGN_OR_RETURN_ERRNO(auto contents, GetContents("/proc/self/statm"));
std::vector<std::string> parts = absl::StrSplit(contents, ' ');
if (parts.empty()) {
return PosixError(EINVAL, "Unable to parse /proc/self/statm");
}
- ASSIGN_OR_RETURN_ERRNO(auto pages, Atoi<int64_t>(parts[0]));
+ ASSIGN_OR_RETURN_ERRNO(auto pages, Atoi<int64>(parts[0]));
return pages * getpagesize();
}
@@ -245,7 +245,7 @@ TEST_F(MMapTest, MapDevZeroSharedFdNoPersistence) {
// Create a second mapping via the same fd.
void* psec_map = mmap(nullptr, kPageSize, PROT_READ | PROT_WRITE, MAP_SHARED,
dev_zero.get(), 0);
- ASSERT_THAT(reinterpret_cast<int64_t>(psec_map), SyscallSucceeds());
+ ASSERT_THAT(reinterpret_cast<int64>(psec_map), SyscallSucceeds());
// Always unmap.
auto cleanup_psec_map = Cleanup(
@@ -690,10 +690,10 @@ TEST_F(MMapTest, ExceedLimitDataPrlimitPID) {
}
TEST_F(MMapTest, NoExceedLimitAS) {
- constexpr uint64_t kAllocBytes = 200 << 20;
+ constexpr uint64 kAllocBytes = 200 << 20;
// Add some headroom to the AS limit in case of e.g. unexpected stack
// expansion.
- constexpr uint64_t kExtraASBytes = kAllocBytes + (20 << 20);
+ constexpr uint64 kExtraASBytes = kAllocBytes + (20 << 20);
static_assert(kAllocBytes < kExtraASBytes,
"test depends on allocation not exceeding AS limit");
@@ -708,10 +708,10 @@ TEST_F(MMapTest, NoExceedLimitAS) {
}
TEST_F(MMapTest, ExceedLimitAS) {
- constexpr uint64_t kAllocBytes = 200 << 20;
+ constexpr uint64 kAllocBytes = 200 << 20;
// Add some headroom to the AS limit in case of e.g. unexpected stack
// expansion.
- constexpr uint64_t kExtraASBytes = 20 << 20;
+ constexpr uint64 kExtraASBytes = 20 << 20;
static_assert(kAllocBytes > kExtraASBytes,
"test depends on allocation exceeding AS limit");
@@ -1469,7 +1469,7 @@ TEST_F(MMapFileTest, InternalSigBusZeroing) {
SyscallFailsWithErrno(EFAULT));
}
-// Checks that mmaps with a length of uint64_t(-PAGE_SIZE + 1) or greater do not
+// Checks that mmaps with a length of uint64(-PAGE_SIZE + 1) or greater do not
// induce a sentry panic (due to "rounding up" to 0).
TEST_F(MMapTest, HugeLength) {
EXPECT_THAT(Map(0, static_cast<uint64_t>(-kPageSize + 1), PROT_NONE,