<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Weak Unit Test: HashingTest.HashValueBasicTest"
   href="https://bugs.llvm.org/show_bug.cgi?id=38387">38387</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Weak Unit Test: HashingTest.HashValueBasicTest
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>1101.debian@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello, 

I'm (very slowly) analyzing quality of the LLVM's test suite using mutation
testing[1].
I started with ADTTests and the very first weak test I found is the following:

    HashingTest.HashValueBasicTest: unittests/ADT/HashingTest.cpp:58

Seems like the test does not test actual implementation.

I was able to reduce original function from

    inline hash_code hash_integer_value(uint64_t value) {
      // Similar to hash_4to8_bytes but using a seed instead of length.
      const uint64_t seed = get_execution_seed();
      const char *s = reinterpret_cast<const char *>(&value);
      const uint64_t a = fetch32(s);
      return hash_16_bytes(seed + (a << 3), fetch32(s + 4));
    }

to

    inline hash_code hash_integer_value(uint64_t value) {
      // Similar to hash_4to8_bytes but using a seed instead of length.
      const char *s = reinterpret_cast<const char *>(&value);
      return hash_16_bytes(0, fetch32(s));
    }

Code coverage in both cases is 100%, but all the tests are still passing.

I hope it helps.

[1] <a href="https://github.com/mull-project/mull">https://github.com/mull-project/mull</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>