On Tue, Mar 3, 2009 at 4:49 PM, William Chan (陈智昌)
<willc...@chromium.org> wrote:
>
> My old team never really used FRIEND_TEST.  We found it ugly that our



> production code depended on test code.  We typically used friended
> "Peer" classes defined in the unittest file, but not in the anonymous
> namespace.  These are simple shims that provide access to the private
> section.  It also saves on having to FRIEND_TEST each individual test
> as you add them.  It looks like almost every time FRIEND_TEST is used,
> it's used for multiple tests, not just a single one.  I'm not sure how
> much of a problem chrome has with build dependencies leading to
> rebuilds, but it was very annoying in google projects to add a
> FRIEND_TEST to a widely used .h file, thus forcing everyone to
> rebuild, even though you're only adding a new test.

In some cases we make a class that derives from testing::Test a
friend, and write pass-throughs there. I agree it's a good idea if we
have many tests that need this for the same tested class. We don't
have a whole lot of FRIEND_TESTs in the first place, so it probably
isn't a big deal for us.

Brett

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to