From a3ece96f9f87e7219350498486975c5b8deccd83 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 21 Dec 2016 18:44:20 -0800 Subject: tests: Replace the O_RDONLY in access(2). Although O_RDONLY gives the same value as F_OK (0), it's not the right friend of access(2). Also clean up the temporary files from ZipTest (TemporaryDir doesn't like non-empty directory). Test: recovery_unit_test passes and has no leftover. Change-Id: I66b90e43c0954c89ce08b36b9e2b4e84183b28f5 --- tests/manual/recovery_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/manual/recovery_test.cpp') diff --git a/tests/manual/recovery_test.cpp b/tests/manual/recovery_test.cpp index e83849546..e73cb1509 100644 --- a/tests/manual/recovery_test.cpp +++ b/tests/manual/recovery_test.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include #include @@ -79,7 +78,7 @@ TEST(recovery, persist) { std::string buf; EXPECT_TRUE(android::base::ReadFileToString(myFilename, &buf)); EXPECT_EQ(myContent, buf); - if (access(myFilename.c_str(), O_RDONLY) == 0) { + if (access(myFilename.c_str(), F_OK) == 0) { fprintf(stderr, "Removing persistent test data, " "check if reconstructed on reboot\n"); } -- cgit v1.2.3