Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 54d7188

Browse files
author
Julien Gilli
committedFeb 16, 2015
deps: add profiler log version test
431eb17 had integrated the addition of V8's version in V8's profiler log files, without backporting the test that was included in the original change (https://codereview.chromium.org/806143002). This commit backports this test. The newly added test was tested with nodejs#9208.
1 parent 1f76c61 commit 54d7188

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed
 

‎deps/v8/src/log-utils.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void Log::Initialize(const char* log_file_name) {
5454

5555
if (output_handle_ != NULL) {
5656
Log::MessageBuilder msg(this);
57-
msg.Append("v8-version,%d,%d,%d,%d,%d\n", Version::GetMajor(),
57+
msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
5858
Version::GetMinor(), Version::GetBuild(), Version::GetPatch(),
5959
Version::IsCandidate());
6060
msg.WriteToLogFile();

‎deps/v8/test/cctest/test-log.cc

+11-16
Original file line numberDiff line numberDiff line change
@@ -496,20 +496,15 @@ TEST(EquivalenceOfLoggingAndTraversal) {
496496
}
497497

498498
TEST(LogVersion) {
499-
v8::Isolate* isolate;
500-
{
501-
ScopedLoggerInitializer initialize_logger;
502-
isolate = initialize_logger.isolate();
503-
bool exists = false;
504-
i::Vector<const char> log(
505-
i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
506-
CHECK(exists);
507-
i::EmbeddedVector<char, 100> ref_data;
508-
i::SNPrintF(ref_data, "v8-version,%d,%d,%d,%d,%d", i::Version::GetMajor(),
509-
i::Version::GetMinor(), i::Version::GetBuild(),
510-
i::Version::GetPatch(), i::Version::IsCandidate());
511-
CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length()));
512-
log.Dispose();
513-
}
514-
isolate->Dispose();
499+
ScopedLoggerInitializer initialize_logger;
500+
bool exists = false;
501+
i::Vector<const char> log(
502+
i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
503+
CHECK(exists);
504+
i::EmbeddedVector<char, 100> ref_data;
505+
i::SNPrintF(ref_data, "v8-version,%d,%d,%d,%d,%d", i::Version::GetMajor(),
506+
i::Version::GetMinor(), i::Version::GetBuild(),
507+
i::Version::GetPatch(), i::Version::IsCandidate());
508+
CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length()));
509+
log.Dispose();
515510
}

0 commit comments

Comments
 (0)
Please sign in to comment.