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

Unified Diff: third_party/re2/re2/testing/re2_arg_test.cc

Issue 1516543002: Update re2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated update instructions Created 5 years 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 | « third_party/re2/re2/testing/random_test.cc ('k') | third_party/re2/re2/testing/re2_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/re2/testing/re2_arg_test.cc
diff --git a/third_party/re2/re2/testing/re2_arg_test.cc b/third_party/re2/re2/testing/re2_arg_test.cc
index ae7a7b0dc5065178f9ca8c8dd52a7420cc59a00b..d843ffa5fadd9d5eb0e9a2c447b8bdae6ad15a95 100644
--- a/third_party/re2/re2/testing/re2_arg_test.cc
+++ b/third_party/re2/re2/testing/re2_arg_test.cc
@@ -84,24 +84,24 @@ const SuccessTable kSuccessTable[] = {
{ "18446744073709551616", 0, { false, false, false, false, false, false }},
};
-const int kNumStrings = ARRAYSIZE(kSuccessTable);
+const int kNumStrings = arraysize(kSuccessTable);
-// It's ugly to use a macro, but we apparently can't use the ASSERT_TRUE_M
+// It's ugly to use a macro, but we apparently can't use the EXPECT_EQ
// macro outside of a TEST block and this seems to be the only way to
// avoid code duplication. I can also pull off a couple nice tricks
// using concatenation for the type I'm checking against.
#define PARSE_FOR_TYPE(type, column) { \
type r; \
- for ( int i = 0; i < kNumStrings; ++i ) { \
+ for (int i = 0; i < kNumStrings; ++i) { \
RE2::Arg arg(&r); \
const char* const p = kSuccessTable[i].value_string; \
- bool retval = arg.Parse(p, strlen(p)); \
+ bool retval = arg.Parse(p, static_cast<int>(strlen(p))); \
bool success = kSuccessTable[i].success[column]; \
- ASSERT_TRUE_M(retval == success, \
- StringPrintf("Parsing '%s' for type " #type " should return %d", \
- p, success).c_str()); \
- if ( success ) { \
- ASSERT_EQUALS(r, kSuccessTable[i].value); \
+ EXPECT_EQ(retval, success) \
+ << "Parsing '" << p << "' for type " #type " should return " \
+ << success; \
+ if (success) { \
+ EXPECT_EQ(r, (type)kSuccessTable[i].value); \
} \
} \
}
« no previous file with comments | « third_party/re2/re2/testing/random_test.cc ('k') | third_party/re2/re2/testing/re2_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698