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

Unified Diff: runtime/vm/unit_test.cc

Issue 1341473002: Fix a variety of service protocol bugs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months 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 | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.cc
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index 421bbdcabc4444d2d9d233ad169b270a9f9a4598..969452759a1ad5ac821be0634ea7a1ad61dd0c8d 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -282,4 +282,24 @@ bool CompilerTest::TestCompileFunction(const Function& function) {
}
+void ElideJSONSubstring(const char* prefix, const char* in, char* out) {
+ const char* pos = strstr(in, prefix);
+ while (pos != NULL) {
+ // Copy up to pos into the output buffer.
+ while (in < pos) {
+ *out++ = *in++;
+ }
+
+ // Skip to the close quote.
+ in += strcspn(in, "\"");
+ pos = strstr(in, prefix);
+ }
+ // Copy the remainder of in to out.
+ while (*in != '\0') {
+ *out++ = *in++;
+ }
+ *out = '\0';
+}
+
+
} // namespace dart
« no previous file with comments | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698