diff options
author | Alexander Potapenko <glider@google.com> | 2015-03-23 10:10:46 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2015-03-23 10:10:46 +0000 |
commit | 4d0be6c4675a1b194b469581da6190a97994fba0 (patch) | |
tree | b5df15157d5d5e74e6ac942ab32a5249764b9964 /lib/sanitizer_common/tests | |
parent | 406b781cedefb25463de9d8ff537e0817fef2d7a (diff) |
[ASan] Distinguish between read, write and read-write file access modes in OpenFile.
This is to fix mapping coverage files into memory on OSX.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@232936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/tests')
-rw-r--r-- | lib/sanitizer_common/tests/sanitizer_libc_test.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sanitizer_common/tests/sanitizer_libc_test.cc b/lib/sanitizer_common/tests/sanitizer_libc_test.cc index 8712d2c1b..689c6ed40 100644 --- a/lib/sanitizer_common/tests/sanitizer_libc_test.cc +++ b/lib/sanitizer_common/tests/sanitizer_libc_test.cc @@ -78,14 +78,14 @@ TEST(SanitizerCommon, FileOps) { char tmpfile[128]; temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.fileops.tmp."); - uptr openrv = OpenFile(tmpfile, true); + uptr openrv = OpenFile(tmpfile, WrOnly); EXPECT_FALSE(internal_iserror(openrv)); fd_t fd = openrv; EXPECT_EQ(len1, internal_write(fd, str1, len1)); EXPECT_EQ(len2, internal_write(fd, str2, len2)); internal_close(fd); - openrv = OpenFile(tmpfile, false); + openrv = OpenFile(tmpfile, WrOnly); EXPECT_FALSE(internal_iserror(openrv)); fd = openrv; uptr fsize = internal_filesize(fd); @@ -134,7 +134,7 @@ TEST(SanitizerCommon, InternalMmapWithOffset) { char tmpfile[128]; temp_file_name(tmpfile, sizeof(tmpfile), "sanitizer_common.internalmmapwithoffset.tmp."); - uptr res = OpenFile(tmpfile, true); + uptr res = OpenFile(tmpfile, WrOnly); ASSERT_FALSE(internal_iserror(res)); fd_t fd = res; |