summaryrefslogtreecommitdiff
path: root/memory_replay
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-10-20 20:28:29 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-10-20 20:28:29 +0000
commit5321b63ea2063e4246543009c763584498d1e56d (patch)
tree26a2dbdcf5aaecd2654affe0b4e1b25f037f1dc8 /memory_replay
parent01e57b832ab732199824ac6bda0b804eaad62b94 (diff)
parent57b648ab50307e0de2750c864b5db2a83604338b (diff)
downloadextras-5321b63ea2063e4246543009c763584498d1e56d.tar.gz
Merge "Fix lseek argument order."
Diffstat (limited to 'memory_replay')
-rw-r--r--memory_replay/main.cpp4
-rw-r--r--memory_replay/tests/LineBufferTest.cpp14
-rw-r--r--memory_replay/tests/NativeInfoTest.cpp8
3 files changed, 13 insertions, 13 deletions
diff --git a/memory_replay/main.cpp b/memory_replay/main.cpp
index ce5fcdf0..b4dbef24 100644
--- a/memory_replay/main.cpp
+++ b/memory_replay/main.cpp
@@ -36,7 +36,7 @@
static char g_buffer[65535];
size_t GetMaxAllocs(int fd) {
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
LineBuffer line_buf(fd, g_buffer, sizeof(g_buffer));
char* line;
size_t line_len;
@@ -67,7 +67,7 @@ size_t GetMaxAllocs(int fd) {
}
void ProcessDump(int fd, size_t max_allocs, size_t max_threads) {
- lseek(fd, SEEK_SET, 0);
+ lseek(fd, 0, SEEK_SET);
Pointers pointers(max_allocs);
Threads threads(&pointers, max_threads);
diff --git a/memory_replay/tests/LineBufferTest.cpp b/memory_replay/tests/LineBufferTest.cpp
index 8e9976e5..56bdb918 100644
--- a/memory_replay/tests/LineBufferTest.cpp
+++ b/memory_replay/tests/LineBufferTest.cpp
@@ -41,7 +41,7 @@ TEST_F(LineBufferTest, single_line) {
line_data += "Single line with newline.\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[100];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
@@ -60,7 +60,7 @@ TEST_F(LineBufferTest, single_line_no_newline) {
line_data += "Single line with no newline.";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[100];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
@@ -81,7 +81,7 @@ TEST_F(LineBufferTest, single_read) {
line_data += "Third line is last.\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[100];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
@@ -110,7 +110,7 @@ TEST_F(LineBufferTest, single_read_no_end_newline) {
line_data += "Third line is last no newline.";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[100];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
@@ -140,7 +140,7 @@ TEST_F(LineBufferTest, one_line_per_read) {
line_data += "The fourth line.\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[24];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
@@ -175,7 +175,7 @@ TEST_F(LineBufferTest, multiple_line_per_read_multiple_reads) {
line_data += "The fourth line.\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[60];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
@@ -210,7 +210,7 @@ TEST_F(LineBufferTest, line_larger_than_buffer) {
line_data += "The fourth line.\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, line_data.c_str(), line_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
char buffer[25];
LineBuffer line_buf(tmp_file_->fd, buffer, sizeof(buffer));
diff --git a/memory_replay/tests/NativeInfoTest.cpp b/memory_replay/tests/NativeInfoTest.cpp
index 89f314ec..e527e46d 100644
--- a/memory_replay/tests/NativeInfoTest.cpp
+++ b/memory_replay/tests/NativeInfoTest.cpp
@@ -57,7 +57,7 @@ TEST_F(NativeInfoTest, no_matching) {
"Name: [anon:thread signal stack]\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, smaps_data.c_str(), smaps_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
size_t pss_bytes = 1;
size_t va_bytes = 1;
@@ -118,7 +118,7 @@ TEST_F(NativeInfoTest, multiple_anons) {
"Name:\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, smaps_data.c_str(), smaps_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
size_t pss_bytes = 1;
size_t va_bytes = 1;
@@ -179,7 +179,7 @@ TEST_F(NativeInfoTest, multiple_heaps) {
"Name:\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, smaps_data.c_str(), smaps_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
size_t pss_bytes = 1;
size_t va_bytes = 1;
@@ -256,7 +256,7 @@ TEST_F(NativeInfoTest, mix_heap_anon) {
"Name:\n";
ASSERT_TRUE(TEMP_FAILURE_RETRY(
write(tmp_file_->fd, smaps_data.c_str(), smaps_data.size())) != -1);
- ASSERT_TRUE(lseek(tmp_file_->fd, SEEK_SET, 0) != off_t(-1));
+ ASSERT_TRUE(lseek(tmp_file_->fd, 0, SEEK_SET) != off_t(-1));
size_t pss_bytes = 1;
size_t va_bytes = 1;