summaryrefslogtreecommitdiff
path: root/init/util_test.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2019-05-27 10:56:44 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-05-27 10:56:44 -0700
commit0e68ab18fbef221e1a18fbf63babfd5d17bf3b2c (patch)
tree62d78b6f2b3873de7c078a44a0f7b294e68cdd7e /init/util_test.cpp
parent8c261482b8cbf3219cfc646b62a7404951d69905 (diff)
parent13775b21afcdde6bb88d7390030d39a9cd6165ea (diff)
Merge "init: replace Result<> with expected<>" am: 7d1f11759a am: b1012c9de8 am: eb87c4be66
am: 13775b21af Change-Id: I426e4ea8314a46025596614beb88ca68a99a6a92
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);