summaryrefslogtreecommitdiffstats
path: root/adb/adb_io_test.cpp
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-03-13 22:39:54 -0700
committerDan Albert <danalbert@google.com>2015-03-14 16:36:18 -0700
commit98ff77204cef9bb8f0f27420833233622060a09e (patch)
tree54d1196083e2e4dc4b53353a2a77be6abd265066 /adb/adb_io_test.cpp
parentf1c2ba490ef979b3d347f08535ab8b817e917e62 (diff)
downloadsystem_core-98ff77204cef9bb8f0f27420833233622060a09e.zip
system_core-98ff77204cef9bb8f0f27420833233622060a09e.tar.gz
system_core-98ff77204cef9bb8f0f27420833233622060a09e.tar.bz2
Create libbase.
Move StringPrintf and the string based file I/O from libutils to libbase. Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
Diffstat (limited to 'adb/adb_io_test.cpp')
-rw-r--r--adb/adb_io_test.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/adb/adb_io_test.cpp b/adb/adb_io_test.cpp
index 330d9ce..0c69bc9 100644
--- a/adb/adb_io_test.cpp
+++ b/adb/adb_io_test.cpp
@@ -24,7 +24,7 @@
#include <string>
-#include "utils/file.h"
+#include "base/file.h"
class TemporaryFile {
public:
@@ -55,7 +55,7 @@ TEST(io, ReadFdExactly_whole) {
TemporaryFile tf;
ASSERT_NE(-1, tf.fd);
- ASSERT_TRUE(android::WriteStringToFd(expected, tf.fd)) << strerror(errno);
+ ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno);
ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0));
// Test reading the whole file.
@@ -69,7 +69,7 @@ TEST(io, ReadFdExactly_eof) {
TemporaryFile tf;
ASSERT_NE(-1, tf.fd);
- ASSERT_TRUE(android::WriteStringToFd(expected, tf.fd)) << strerror(errno);
+ ASSERT_TRUE(android::base::WriteStringToFd(expected, tf.fd)) << strerror(errno);
ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0));
// Test that not having enough data will fail.
@@ -83,7 +83,7 @@ TEST(io, ReadFdExactly_partial) {
TemporaryFile tf;
ASSERT_NE(-1, tf.fd);
- ASSERT_TRUE(android::WriteStringToFd(input, tf.fd)) << strerror(errno);
+ ASSERT_TRUE(android::base::WriteStringToFd(input, tf.fd)) << strerror(errno);
ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0));
// Test reading a partial file.
@@ -106,7 +106,7 @@ TEST(io, WriteFdExactly_whole) {
ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0));
std::string s;
- ASSERT_TRUE(android::ReadFdToString(tf.fd, &s));
+ ASSERT_TRUE(android::base::ReadFdToString(tf.fd, &s));
EXPECT_STREQ(expected, s.c_str());
}
@@ -123,7 +123,7 @@ TEST(io, WriteFdExactly_partial) {
expected.pop_back();
std::string s;
- ASSERT_TRUE(android::ReadFdToString(tf.fd, &s));
+ ASSERT_TRUE(android::base::ReadFdToString(tf.fd, &s));
EXPECT_EQ(expected, s);
}
@@ -137,6 +137,6 @@ TEST(io, WriteStringFully) {
ASSERT_EQ(0, lseek(tf.fd, SEEK_SET, 0));
std::string s;
- ASSERT_TRUE(android::ReadFdToString(tf.fd, &s));
+ ASSERT_TRUE(android::base::ReadFdToString(tf.fd, &s));
EXPECT_STREQ(str, s.c_str());
}