summaryrefslogtreecommitdiff
path: root/tools/aapt2/io/FileStream_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt2/io/FileStream_test.cpp')
-rw-r--r--tools/aapt2/io/FileStream_test.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/aapt2/io/FileStream_test.cpp b/tools/aapt2/io/FileStream_test.cpp
index 68c3cb1f4156..a6d58caa07b7 100644
--- a/tools/aapt2/io/FileStream_test.cpp
+++ b/tools/aapt2/io/FileStream_test.cpp
@@ -87,10 +87,8 @@ TEST(FileOutputStreamTest, NextAndBackup) {
const std::string input = "this is a cool string";
TemporaryFile file;
- int fd = file.release();
- // FileOutputStream takes ownership.
- FileOutputStream out(fd, 10u);
+ FileOutputStream out(file.fd, 10u);
ASSERT_FALSE(out.HadError());
EXPECT_THAT(out.ByteCount(), Eq(0u));
@@ -118,10 +116,10 @@ TEST(FileOutputStreamTest, NextAndBackup) {
ASSERT_TRUE(out.Flush());
- lseek64(fd, 0, SEEK_SET);
+ lseek64(file.fd, 0, SEEK_SET);
std::string actual;
- ASSERT_TRUE(android::base::ReadFdToString(fd, &actual));
+ ASSERT_TRUE(android::base::ReadFdToString(file.fd, &actual));
EXPECT_THAT(actual, StrEq(input));
}