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

Unified Diff: test/cctest/test-log.cc

Issue 115123: Return immediately from GetLogLines if logging to memory isn't enabled. (Closed)
Patch Set: Created 11 years, 7 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
« src/log.cc ('K') | « src/log.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-log.cc
diff --git a/test/cctest/test-log.cc b/test/cctest/test-log.cc
index 0370cbec45196ed67ea1cd790366f40bd996e943..6a7e54f1d11af69765201f6d62a48881dc9b2291 100644
--- a/test/cctest/test-log.cc
+++ b/test/cctest/test-log.cc
@@ -23,6 +23,7 @@ static void TearDown() {
Logger::TearDown();
}
+
TEST(EmptyLog) {
SetUp();
CHECK_EQ(0, Logger::GetLogLines(0, NULL, 0));
@@ -99,4 +100,18 @@ TEST(BeyondWritePosition) {
TearDown();
}
+
+TEST(MemoryLoggingTurnedOff) {
+ // Log to stdout
+ v8::internal::FLAG_logfile = "-";
+ v8::internal::FLAG_log = true;
+ Logger::Setup();
+ CHECK_EQ(0, Logger::GetLogLines(0, NULL, 0));
+ CHECK_EQ(0, Logger::GetLogLines(100, NULL, 0));
+ CHECK_EQ(0, Logger::GetLogLines(0, NULL, 100));
+ CHECK_EQ(0, Logger::GetLogLines(100, NULL, 100));
+ Logger::TearDown();
+}
+
+
#endif // ENABLE_LOGGING_AND_PROFILING
« src/log.cc ('K') | « src/log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698