mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Bug 1912414 - Add TEST_TRY macro; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D194365
This commit is contained in:
1 parent
66de793ec5
commit
1905479ca5
1 file changed
+8
@@ -30,6 +30,14 @@ GTEST_API_ ::testing::AssertionResult CmpHelperSTREQ(const char* s1_expression,
|
||||
#define ASSERT_NSEQ(lhs, rhs) \
|
||||
ASSERT_STREQ(GetStaticErrorName((lhs)), GetStaticErrorName((rhs)))
|
||||
|
||||
#define TEST_TRY_META(tempVar, expr) \
|
||||
auto MOZ_REMOVE_PAREN(tempVar) = (expr); \
|
||||
ASSERT_TRUE(MOZ_REMOVE_PAREN(tempVar).isOk()) \
|
||||
<< GetStaticErrorName( \
|
||||
mozilla::ToNSResult(MOZ_REMOVE_PAREN(tempVar).unwrapErr()));
|
||||
|
||||
#define TEST_TRY(expr) TEST_TRY_META(MOZ_UNIQUE_VAR(testVar), expr)
|
||||
|
||||
#define TEST_TRY_UNWRAP_META(tempVar, target, expr) \
|
||||
auto MOZ_REMOVE_PAREN(tempVar) = (expr); \
|
||||
ASSERT_TRUE(MOZ_REMOVE_PAREN(tempVar).isOk()) \
|
||||
|
||||
Reference in new issue
Block a user