Move logic to write to stdout into CodeWriter
This will allow us to reuse it when we write C++ code.
I think this will mostly come in handy for debugging.
While here, rename the helper functions in accordance with the style
guide.
Test: unittests
Bug: 24220933
Change-Id: I269eb4a0dda10588c2ae77b7c8f2b00e50e70047
diff --git a/ast_cpp_unittest.cpp b/ast_cpp_unittest.cpp
index ce1981d..0b2d707 100644
--- a/ast_cpp_unittest.cpp
+++ b/ast_cpp_unittest.cpp
@@ -79,7 +79,7 @@
}}
};
string actual_output;
- CodeWriterPtr writer = get_string_writer(&actual_output);
+ CodeWriterPtr writer = GetStringWriter(&actual_output);
cpp_header.Write(writer.get());
EXPECT_EQ(string(kExpectedHeaderOutput), actual_output);
}