summaryrefslogtreecommitdiff
path: root/init/util_test.cpp
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-05-31 03:43:34 +0900
committerJiyong Park <jiyong@google.com>2019-06-06 08:58:55 +0900
commit8fd64c8af11e29a270bff6688f52589afb2b0466 (patch)
tree51cb7ec12139129ec9795603d5e962f2e64a2e90 /init/util_test.cpp
parentf74ff74475494e25ab27a507ff55bfefb78ff905 (diff)
Move result.h from init to libbase
The Result, Error, ErrnoError are quite generic. Moving them from init to libbase so that they can be used from other places. Bug: 132145659 Test: libbase_test Change-Id: Id774a587f74380fadd7a0fc88c0aa892c3d9a489
Diffstat (limited to 'init/util_test.cpp')
-rw-r--r--init/util_test.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/init/util_test.cpp b/init/util_test.cpp
index 8bf672c0e..8947256cf 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().as_string);
+ EXPECT_EQ("open() failed: No such file or directory", file_contents.error().message());
}
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().as_string);
+ EXPECT_EQ("Skipping insecure file", file_contents.error().message());
}
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().as_string);
+ EXPECT_EQ("Skipping insecure file", file_contents.error().message());
}
TEST(util, ReadFileSymbolicLink) {
@@ -66,7 +66,7 @@ TEST(util, ReadFileSymbolicLink) {
EXPECT_EQ(ELOOP, errno);
ASSERT_FALSE(file_contents);
EXPECT_EQ("open() failed: Too many symbolic links encountered",
- file_contents.error().as_string);
+ file_contents.error().message());
}
TEST(util, ReadFileSuccess) {
@@ -131,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().as_string);
+ EXPECT_EQ("getpwnam failed: No such file or directory", decoded_uid.error().message());
decoded_uid = DecodeUid("123");
EXPECT_TRUE(decoded_uid);