[llvm] r211080 - Expose ValueMap's mutex type as a typedef instead of a sys::Mutex.

Zachary Turner zturner at google.com
Tue Jun 17 11:31:32 PDT 2014


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.

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.


On Tue, Jun 17, 2014 at 11:27 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> On 17 June 2014 14:26, Zachary Turner <zturner at google.com> wrote:
> > Well the class holds only a pointer to a sys::Mutex, so in theory it can
> be
> > used in any many possible ways.  I think this unit test is only intended
> to
> > test the class itself, not clients of the class.
>
> Yes, what I mean is that it is testing something that doesn't seem to be
> used.
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140617/e3188e31/attachment.html>


More information about the llvm-commits mailing list