Make some unit tests use mock file output
[alexxy/gromacs.git] / src / gromacs / commandline / cmdlinehelpcontext.cpp
index cfe32fbf38905227976a8f86633fd6fdb9ace6d6..d1af037ef5898431e6d590d52f98676823d32245 100644 (file)
@@ -74,8 +74,9 @@ class CommandLineHelpContext::Impl
 {
     public:
         //! Creates the implementation class and the low-level context.
-        Impl(File *file, HelpOutputFormat format, const HelpLinks *links)
-            : writerContext_(file, format, links), moduleDisplayName_("gmx"),
+        Impl(TextOutputStream *stream, HelpOutputFormat format,
+             const HelpLinks *links)
+            : writerContext_(stream, format, links), moduleDisplayName_("gmx"),
               completionWriter_(NULL), bHidden_(false)
         {
         }
@@ -97,9 +98,9 @@ class CommandLineHelpContext::Impl
 };
 
 CommandLineHelpContext::CommandLineHelpContext(
-        File *file, HelpOutputFormat format, const HelpLinks *links,
-        const std::string &programName)
-    : impl_(new Impl(file, format, links))
+        TextOutputStream *stream, HelpOutputFormat format,
+        const HelpLinks *links, const std::string &programName)
+    : impl_(new Impl(stream, format, links))
 {
     impl_->writerContext_.setReplacement("[PROGRAM]", programName);
 }
@@ -112,7 +113,7 @@ CommandLineHelpContext::CommandLineHelpContext(
 
 CommandLineHelpContext::CommandLineHelpContext(
         ShellCompletionWriter *writer)
-    : impl_(new Impl(writer->outputFile(), eHelpOutputFormat_Other, NULL))
+    : impl_(new Impl(&writer->outputStream(), eHelpOutputFormat_Other, NULL))
 {
     impl_->completionWriter_ = writer;
 }