summaryrefslogtreecommitdiff
path: root/init/util_test.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-05-28 03:12:05 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-05-28 03:12:05 +0000
commit6220136528a29e96838bf6e18ea81dad9995cecc (patch)
tree62d78b6f2b3873de7c078a44a0f7b294e68cdd7e /init/util_test.cpp
parent8c2ad73742ead5dd9cec3ac78be9ca002ca8ee38 (diff)
parent0e68ab18fbef221e1a18fbf63babfd5d17bf3b2c (diff)
Snap for 5608795 from 0e68ab18fbef221e1a18fbf63babfd5d17bf3b2c to rvc-release
Change-Id: I43f1c8b8baeaab87a6a5eb0d4821df44124bb622
Diffstat (limited to 'init/util_test.cpp')
-rw-r--r--init/util_test.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/init/util_test.cpp b/init/util_test.cpp
index 1b5afba27..8bf672c0e 100644
--- a/init/util_test.cpp
+++ b/init/util_test.cpp
@@ -34,7 +34,7 @@ TEST(util, ReadFile_ENOENT) {
auto file_contents = ReadFile("/proc/does-not-exist");
EXPECT_EQ(ENOENT, errno);
ASSERT_FALSE(file_contents);
- EXPECT_EQ("open() failed: No such file or directory", file_contents.error_string());
+ EXPECT_EQ("open() failed: No such file or directory", file_contents.error().as_string);
}
TEST(util, ReadFileGroupWriteable) {
@@ -45,7 +45,7 @@ TEST(util, ReadFileGroupWriteable) {
EXPECT_NE(-1, fchmodat(AT_FDCWD, tf.path, 0620, AT_SYMLINK_NOFOLLOW)) << strerror(errno);
auto file_contents = ReadFile(tf.path);
ASSERT_FALSE(file_contents) << strerror(errno);
- EXPECT_EQ("Skipping insecure file", file_contents.error_string());
+ EXPECT_EQ("Skipping insecure file", file_contents.error().as_string);
}
TEST(util, ReadFileWorldWiteable) {
@@ -56,7 +56,7 @@ TEST(util, ReadFileWorldWiteable) {
EXPECT_NE(-1, fchmodat(AT_FDCWD, tf.path, 0602, AT_SYMLINK_NOFOLLOW)) << strerror(errno);
auto file_contents = ReadFile(tf.path);
ASSERT_FALSE(file_contents) << strerror(errno);
- EXPECT_EQ("Skipping insecure file", file_contents.error_string());
+ EXPECT_EQ("Skipping insecure file", file_contents.error().as_string);
}
TEST(util, ReadFileSymbolicLink) {
@@ -65,7 +65,8 @@ TEST(util, ReadFileSymbolicLink) {
auto file_contents = ReadFile("/charger");
EXPECT_EQ(ELOOP, errno);
ASSERT_FALSE(file_contents);
- EXPECT_EQ("open() failed: Too many symbolic links encountered", file_contents.error_string());
+ EXPECT_EQ("open() failed: Too many symbolic links encountered",
+ file_contents.error().as_string);
}
TEST(util, ReadFileSuccess) {
@@ -130,7 +131,7 @@ TEST(util, DecodeUid) {
decoded_uid = DecodeUid("toot");
EXPECT_FALSE(decoded_uid);
- EXPECT_EQ("getpwnam failed: No such file or directory", decoded_uid.error_string());
+ EXPECT_EQ("getpwnam failed: No such file or directory", decoded_uid.error().as_string);
decoded_uid = DecodeUid("123");
EXPECT_TRUE(decoded_uid);