Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: util/mac/xattr_test.cc

Issue 842223003: Add a tri-state enum to return the result of Xattr operations. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mac/xattr.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mac/xattr_test.cc
diff --git a/util/mac/xattr_test.cc b/util/mac/xattr_test.cc
index c02aa08c383611c5af39f86eeb748e79d3cc7a92..a25cfbb5c0e0dfff3eb219a7362e1714938c6285 100644
--- a/util/mac/xattr_test.cc
+++ b/util/mac/xattr_test.cc
@@ -57,7 +57,7 @@ const char kKey[] = "com.google.crashpad.test";
TEST_F(Xattr, ReadNonExistentXattr) {
std::string value;
- EXPECT_FALSE(ReadXattr(path(), kKey, &value));
+ EXPECT_EQ(XattrStatus::kNoAttribute, ReadXattr(path(), kKey, &value));
}
TEST_F(Xattr, WriteAndReadString) {
@@ -65,7 +65,7 @@ TEST_F(Xattr, WriteAndReadString) {
EXPECT_TRUE(WriteXattr(path(), kKey, value));
std::string actual;
- EXPECT_TRUE(ReadXattr(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattr(path(), kKey, &actual));
EXPECT_EQ(value, actual);
}
@@ -74,18 +74,18 @@ TEST_F(Xattr, WriteAndReadVeryLongString) {
EXPECT_TRUE(WriteXattr(path(), kKey, value));
std::string actual;
- EXPECT_TRUE(ReadXattr(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattr(path(), kKey, &actual));
EXPECT_EQ(value, actual);
}
TEST_F(Xattr, WriteAndReadBool) {
EXPECT_TRUE(WriteXattrBool(path(), kKey, true));
bool actual = false;
- EXPECT_TRUE(ReadXattrBool(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattrBool(path(), kKey, &actual));
EXPECT_TRUE(actual);
EXPECT_TRUE(WriteXattrBool(path(), kKey, false));
- EXPECT_TRUE(ReadXattrBool(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattrBool(path(), kKey, &actual));
EXPECT_FALSE(actual);
}
@@ -94,12 +94,12 @@ TEST_F(Xattr, WriteAndReadInt) {
int actual;
EXPECT_TRUE(WriteXattrInt(path(), kKey, expected));
- EXPECT_TRUE(ReadXattrInt(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattrInt(path(), kKey, &actual));
EXPECT_EQ(expected, actual);
expected = std::numeric_limits<int>::max();
EXPECT_TRUE(WriteXattrInt(path(), kKey, expected));
- EXPECT_TRUE(ReadXattrInt(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattrInt(path(), kKey, &actual));
EXPECT_EQ(expected, actual);
}
@@ -108,12 +108,12 @@ TEST_F(Xattr, WriteAndReadTimeT) {
time_t actual;
EXPECT_TRUE(WriteXattrTimeT(path(), kKey, expected));
- EXPECT_TRUE(ReadXattrTimeT(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattrTimeT(path(), kKey, &actual));
EXPECT_EQ(expected, actual);
expected = std::numeric_limits<time_t>::max();
EXPECT_TRUE(WriteXattrTimeT(path(), kKey, expected));
- EXPECT_TRUE(ReadXattrTimeT(path(), kKey, &actual));
+ EXPECT_EQ(XattrStatus::kOK, ReadXattrTimeT(path(), kKey, &actual));
EXPECT_EQ(expected, actual);
}
« no previous file with comments | « util/mac/xattr.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698