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
Loading
Please register or sign in to comment