@@ -38,6 +38,32 @@ TEST_F(WindowsTest, LaunchMain) {
3838 ASSERT_NE (controller, nullptr );
3939}
4040
41+ // Verify there is no unexpected output from launching main.
42+ TEST_F (WindowsTest, LaunchMainHasNoOutput) {
43+ // Replace stdout & stderr stream buffers with our own.
44+ std::stringstream cout_buffer;
45+ std::stringstream cerr_buffer;
46+ std::streambuf* old_cout_buffer = std::cout.rdbuf ();
47+ std::streambuf* old_cerr_buffer = std::cerr.rdbuf ();
48+ std::cout.rdbuf (cout_buffer.rdbuf ());
49+ std::cerr.rdbuf (cerr_buffer.rdbuf ());
50+
51+ auto & context = GetContext ();
52+ WindowsConfigBuilder builder (context);
53+ ViewControllerPtr controller{builder.Run ()};
54+ ASSERT_NE (controller, nullptr );
55+
56+ // Restore original stdout & stderr stream buffer.
57+ std::cout.rdbuf (old_cout_buffer);
58+ std::cerr.rdbuf (old_cerr_buffer);
59+
60+ // Verify stdout & stderr have no output.
61+ std::string cout = cout_buffer.str ();
62+ std::string cerr = cerr_buffer.str ();
63+ EXPECT_TRUE (cout.empty ());
64+ EXPECT_TRUE (cerr.empty ());
65+ }
66+
4167// Verify we can successfully launch a custom entry point.
4268TEST_F (WindowsTest, LaunchCustomEntrypoint) {
4369 auto & context = GetContext ();
0 commit comments