Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1131)

Issue 42225: Change some DCHECK( == 0), to DCHECK_EQ in the posix lock implementation. (Closed)

Created:
11 years, 9 months ago by Dean McNamee
Modified:
9 years, 7 months ago
Reviewers:
Paweł Hajdan Jr.
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Change DCHECK( == 0) to DCHECK_EQ in the posix lock implementation. It is helpful to see the actual value during a check failure.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M base/lock_impl_posix.cc View 3 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Dean McNamee
11 years, 9 months ago (2009-03-16 12:47:50 UTC) #1
Paweł Hajdan Jr.
I noticed a pattern with ASSERT_EQ, that the expected value goes first, and tested one ...
11 years, 9 months ago (2009-03-16 12:55:06 UTC) #2
Dean McNamee
11 years, 9 months ago (2009-03-16 13:01:43 UTC) #3
With the current ordering, it is most similar to how you would write it using
DCHECK().  For example, here is the output before and after my change:

[...] Check failed: rv == 0. 

[...] Check failed: rv == 0 (22 vs. 0)

I prefer this ordering, but thanks bringing it up.

On 2009/03/16 12:55:06, Paweł Hajdan Jr. wrote:
> I noticed a pattern with ASSERT_EQ, that the expected value goes first, and
> tested one second. I ran a quick git grep on base/ and it seems that a similar
> pattern is generally followed with DCHECK_EQ.
> 
> You may want to change the order of parameters in DCHECK_EQ calls.
> 
> After that, LGTM.

Powered by Google App Engine
This is Rietveld 408576698