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

Unified Diff: test/cctest/test-cpu-profiler.cc

Issue 976203003: CpuProfiler: enable tests except four failing tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: leak was fixed Created 5 years, 10 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 | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc
index c8f052416fe2aad4972d300833dd39c762a75c89..63ccc344e46098b36a363ef58a345a87271adbc7 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -438,8 +438,7 @@ static v8::CpuProfile* RunProfiler(
static bool ContainsString(v8::Handle<v8::String> string,
const Vector<v8::Handle<v8::String> >& vector) {
for (int i = 0; i < vector.length(); i++) {
- if (string->Equals(vector[i]))
- return true;
+ if (string->Equals(vector[i])) return true;
}
return false;
}
@@ -450,11 +449,25 @@ static void CheckChildrenNames(const v8::CpuProfileNode* node,
int count = node->GetChildrenCount();
for (int i = 0; i < count; i++) {
v8::Handle<v8::String> name = node->GetChild(i)->GetFunctionName();
- CHECK(ContainsString(name, names));
+ if (!ContainsString(name, names)) {
+ char buffer[100];
+ i::SNPrintF(Vector<char>(buffer, arraysize(buffer)),
+ "Unexpected child '%s' found in '%s'",
+ *v8::String::Utf8Value(name),
+ *v8::String::Utf8Value(node->GetFunctionName()));
+ FATAL(buffer);
+ }
// Check that there are no duplicates.
for (int j = 0; j < count; j++) {
if (j == i) continue;
- CHECK(!name->Equals(node->GetChild(j)->GetFunctionName()));
+ if (name->Equals(node->GetChild(j)->GetFunctionName())) {
+ char buffer[100];
+ i::SNPrintF(Vector<char>(buffer, arraysize(buffer)),
+ "Second child with the same name '%s' found in '%s'",
+ *v8::String::Utf8Value(name),
+ *v8::String::Utf8Value(node->GetFunctionName()));
+ FATAL(buffer);
+ }
}
}
}
@@ -1125,6 +1138,7 @@ TEST(TickLines) {
break;
}
CHECK_EQ(hit_count, value);
+ delete processor;
yurys 2015/03/05 14:57:40 Why not use SmartPointer?
Sven Panne 2015/03/05 15:05:48 Or even simpler: Just avoid pointers altogether he
}
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698