title: How to unit test function writing to stdout / std::cout
body: <p>I am studying unit testing. From what I've seen, almost all unit tests use return value or an output parameter as the expected value in their test case.</p>
  
  <p>What would be the expected value for a function that has no return value or output parameter?</p>
  
  <p>Example:</p>
  
  <pre><code>void unit_test()
  {
    cout &lt;&lt; "Hello" &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Sure, this function is very simple. So, this function does not seem to need to unit test. But this is just a sample. Do you think <code>unit_test</code> function has a side-effect? How would you test it?</p>