<div dir="ltr">True, but isn't that the point of a unit test? A unit test shouldn't depend on, or have any knowledge of how a class is used, only of how a class *can be* used. We don't know what code will be added in the future, and we shouldn't require someone who uses the class in a different way to go write a new unit test. The unit test should provide coverage of every way the class supports being used. <div>
<br><div>That being said, I don't think any unit tests should even use a mutex to begin with, because thread safety is inherently not unit-testable IMO, and needs different types of testing.</div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 11:27 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 17 June 2014 14:26, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
> Well the class holds only a pointer to a sys::Mutex, so in theory it can be<br>
> used in any many possible ways. I think this unit test is only intended to<br>
> test the class itself, not clients of the class.<br>
<br>
</div>Yes, what I mean is that it is testing something that doesn't seem to be used.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>