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

Unified Diff: runtime/vm/log_test.cc

Issue 2999833002: [VM logging] Fix nesting of log blocker (second attempt). (Closed)
Patch Set: Created 3 years, 4 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/log.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/log_test.cc
diff --git a/runtime/vm/log_test.cc b/runtime/vm/log_test.cc
index ea4670e62770d85ece949fbe17e4c625c309e45b..c64fd21771a916d681237ab6215bcf8323304e27 100644
--- a/runtime/vm/log_test.cc
+++ b/runtime/vm/log_test.cc
@@ -36,6 +36,9 @@ static void TestPrinter(const char* format, ...) {
test_output_ = NULL;
}
test_output_ = buffer;
+
+ // Also print to stdout to see the overall result.
+ OS::Print("%s", test_output_);
}
class LogTestHelper : public AllStatic {
@@ -92,9 +95,15 @@ TEST_CASE(Log_Block) {
log->Print("BANANA");
EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
}
- EXPECT_STREQ("BANANA", test_output_);
+ EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
+ {
+ LogBlock ba(thread, log);
+ log->Print("PEAR");
+ EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
+ }
+ EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
}
- EXPECT_STREQ("APPLE", test_output_);
+ EXPECT_STREQ("APPLEBANANAPEAR", test_output_);
delete log;
LogTestHelper::FreeTestOutput();
}
« no previous file with comments | « runtime/vm/log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698