title: QCOMPARE of two floating-point infinity-values
body: <pre><code>QCOMPARE(
      std::numeric_limits&lt;double&gt;::infinity(),
      std::numeric_limits&lt;double&gt;::infinity());
  </code></pre>
  
  <p>fails with:</p>
  
  <pre><code>Compared doubles are not the same (fuzzy compare)
         Actual   (std::numeric_limits&lt;double&gt;::infinity()): inf
         Expected (std::numeric_limits&lt;double&gt;::infinity()): inf
         Loc: [...]
  </code></pre>
  
  <h3>Question</h3>
  
  <p>Why does this fail? Is there a good work-around (other than using <code>QVERIFY</code> instead)?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I mean a work-around from the perspective of a test-writer. It is desirable to provide a proper diagnostic with the actual value which is not infinity. Instead of </p>
  
  <pre><code>QCOMPARE(val, std::numeric_limits&lt;double&gt;::infinity());
  </code></pre>
  
  <p>one could </p>
  
  <pre><code>QVERIFY(val == std::numeric_limits&lt;double&gt;::infinity()))
  </code></pre>
  
  <p>but the value of <code>val</code> is not shown in the generated diagnostic message if the check fails. Looks like a major oversight from developers.
  So do I have to roll-out my own macro with exact comparison similar to <code>QCOMPARE</code>?  Any recommendations here?  </p>
  
  <p>Also, it is clear that <code>qFuzzyCompare</code> does not support some corner-cases. But I hoped for a more in-depth explanation of why this is the case.</p>