commit | beffc028d699f0493707ee930d3a94af0790c974 | [log] [tgz] |
---|---|---|
author | Bernie Innocenti <codewiz@google.com> | Thu Feb 06 02:51:42 2020 +0900 |
committer | Bernie Innocenti <codewiz@google.com> | Thu Feb 06 15:27:26 2020 +0900 |
tree | 6a776cff512ad10b9a7c308295ba06b27d452df4 | |
parent | 4adfde41eae5b31724ec6092c1405b2913ab535c [diff] |
Add macros to check for successful Result These macros are meant to be used in tests: Result<File> maybe_a_file = OpenFile(...); EXPECT_OK(maybe_a_file); On failure, the error is printed. There's no equivalent EXPECT_NOT_OK() because it is a testing anti-pattern which causes tests to pass even when the error changed as a result of a regression. Use EPECT_EQ(result, Error(...)) instead. Test: cd system/core && atest Test: m Change-Id: Ie26f90d3c62620e7b1f10013829ba43ef5364fe1