|
|
Created:
4 years, 5 months ago by Rob Percival Modified:
4 years, 5 months ago Reviewers:
eroman CC:
chromium-reviews, cbentzel+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionGMock matchers for net::Error
Provides more informative test failure messages.
Committed: https://crrev.com/32886411988498854a43468fe709f634051a1f84
Cr-Commit-Position: refs/heads/master@{#403426}
Patch Set 1 #
Messages
Total messages: 17 (5 generated)
The CQ bit was checked by robpercival@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
robpercival@chromium.org changed reviewers: + eroman@chromium.org
PTAL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
If you decide that this is worth having, I can also, optionally, create a CL that refactors all the existing ASSERT_EQ(net::ERR_*, ...) calls into ASSERT_THAT(..., IsError(net::ERR_*)). That way, all of the net tests benefit (should they ever break). Alternatively, I'm quite happy to just declare these matchers at the top of my own tests.
LGTM. Sure, I am good with such a refactor! (Ideally I think net::Error would be a distinct type from int making it possible to provide this with a pretty printer instead, but that is a different bug...)
The CQ bit was checked by robpercival@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
CQ bit was unchecked.
Message was sent while issue was closed.
Description was changed from ========== GMock matchers for net::Error Provides more informative test failure messages. ========== to ========== GMock matchers for net::Error Provides more informative test failure messages. Committed: https://crrev.com/32886411988498854a43468fe709f634051a1f84 Cr-Commit-Position: refs/heads/master@{#403426} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/32886411988498854a43468fe709f634051a1f84 Cr-Commit-Position: refs/heads/master@{#403426}
Message was sent while issue was closed.
On 2016/07/01 08:28:05, commit-bot: I haz the power wrote: > Patchset 1 (id:??) landed as > https://crrev.com/32886411988498854a43468fe709f634051a1f84 > Cr-Commit-Position: refs/heads/master@{#403426} Hrm...Eric: Sure this is a good idea? I would have pushed back on this, because of obscurity of the syntax, and because I feel that clear test code is more important than clearer test error messages.
Message was sent while issue was closed.
On Mon, Jul 11, 2016 at 8:02 AM, <mmenke@chromium.org> wrote: > On 2016/07/01 08:28:05, commit-bot: I haz the power wrote: > > Patchset 1 (id:??) landed as > > https://crrev.com/32886411988498854a43468fe709f634051a1f84 > > Cr-Commit-Position: refs/heads/master@{#403426} > > Hrm...Eric: Sure this is a good idea? I would have pushed back on this, > because of obscurity of the syntax, and because I feel that clear test > code is > more important than clearer test error messages. > I can certainly sympathize with that argument. My thinking when approving it is that gmock is a dependency elsewhere so like it or not developers need to be familiar with it. The IsError() / IsOk() still felt readable, although admittedly less writable. > https://chromiumcodereview-hr.appspot.com/2111093002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Message was sent while issue was closed.
On 2016/07/12 19:38:00, eroman wrote: > On Mon, Jul 11, 2016 at 8:02 AM, <mailto:mmenke@chromium.org> wrote: > > > On 2016/07/01 08:28:05, commit-bot: I haz the power wrote: > > > Patchset 1 (id:??) landed as > > > https://crrev.com/32886411988498854a43468fe709f634051a1f84 > > > Cr-Commit-Position: refs/heads/master@{#403426} > > > > Hrm...Eric: Sure this is a good idea? I would have pushed back on this, > > because of obscurity of the syntax, and because I feel that clear test > > code is > > more important than clearer test error messages. > > > > I can certainly sympathize with that argument. > > My thinking when approving it is that gmock is a dependency elsewhere so > like it or not developers need to be familiar with it. The IsError() / > IsOk() still felt readable, although admittedly less writable. > > > > https://chromiumcodereview-hr.appspot.com/2111093002/ > > > > -- > You received this message because you are subscribed to the Google Groups > "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to mailto:chromium-reviews+unsubscribe@chromium.org. There is precedence for this in google3, which has testing::status::StatusIs and testing::status::IsOk. Plus, gently introducing GMock matchers in this way has the benefit of making developers aware of their existence and also a bit more comfortable with more advanced uses of GMock, e.g. the built-in set of matchers (https://github.com/google/googletest/blob/master/googlemock/docs/CheatSheet.m...) and mock objects. |