diff options
author | Bernie Innocenti <codewiz@google.com> | 2020-02-12 10:43:42 +0900 |
---|---|---|
committer | Bernie Innocenti <codewiz@google.com> | 2020-02-12 10:43:42 +0900 |
commit | ac5ae3cf5dc4c5f87293c45a1d6999f8d1515b39 (patch) | |
tree | 17a467da0e6fad3ad0fe90ddcc5ff23e9cfe313a /libnativeloader/native_loader_test.cpp | |
parent | af322429596b744d611aeebe3bbaa1003ff64717 (diff) |
Convert native_loader_test.cpp to Result::ok()
Test: m checkbuild
Change-Id: I9feb590e37174fa5021f69bf55dbfffba957584d
Diffstat (limited to 'libnativeloader/native_loader_test.cpp')
-rw-r--r-- | libnativeloader/native_loader_test.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index 39cc753aa4..7064c161a2 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -601,7 +601,7 @@ libD.so )"; const std::vector<std::string> expected_result = {"libA.so", "libC.so", "libD.so"}; Result<std::vector<std::string>> result = ParseConfig(file_content, always_true); - ASSERT_TRUE(result) << result.error().message(); + ASSERT_RESULT_OK(result); ASSERT_EQ(expected_result, *result); } @@ -617,7 +617,7 @@ libC.so const std::vector<std::string> expected_result = {"libA.so", "libC.so"}; #endif Result<std::vector<std::string>> result = ParseConfig(file_content, always_true); - ASSERT_TRUE(result) << result.error().message(); + ASSERT_RESULT_OK(result); ASSERT_EQ(expected_result, *result); } @@ -632,7 +632,7 @@ libC.so Result<std::vector<std::string>> result = ParseConfig(file_content, [](const struct ConfigEntry& entry) -> Result<bool> { return !entry.nopreload; }); - ASSERT_TRUE(result) << result.error().message(); + ASSERT_RESULT_OK(result); ASSERT_EQ(expected_result, *result); } @@ -653,17 +653,17 @@ libE.so nopreload Result<std::vector<std::string>> result = ParseConfig(file_content, [](const struct ConfigEntry& entry) -> Result<bool> { return !entry.nopreload; }); - ASSERT_TRUE(result) << result.error().message(); + ASSERT_RESULT_OK(result); ASSERT_EQ(expected_result, *result); } TEST(NativeLoaderConfigParser, RejectMalformed) { - ASSERT_FALSE(ParseConfig("libA.so 32 64", always_true)); - ASSERT_FALSE(ParseConfig("libA.so 32 32", always_true)); - ASSERT_FALSE(ParseConfig("libA.so 32 nopreload 64", always_true)); - ASSERT_FALSE(ParseConfig("32 libA.so nopreload", always_true)); - ASSERT_FALSE(ParseConfig("nopreload libA.so 32", always_true)); - ASSERT_FALSE(ParseConfig("libA.so nopreload # comment", always_true)); + ASSERT_FALSE(ParseConfig("libA.so 32 64", always_true).ok()); + ASSERT_FALSE(ParseConfig("libA.so 32 32", always_true).ok()); + ASSERT_FALSE(ParseConfig("libA.so 32 nopreload 64", always_true).ok()); + ASSERT_FALSE(ParseConfig("32 libA.so nopreload", always_true).ok()); + ASSERT_FALSE(ParseConfig("nopreload libA.so 32", always_true).ok()); + ASSERT_FALSE(ParseConfig("libA.so nopreload # comment", always_true).ok()); } } // namespace nativeloader |