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

Issue 13318003: Added a StringDescription() function to safely print object pointers that may be nil. (Closed)

Created:
7 years, 8 months ago by pkl (ping after 24h if needed)
Modified:
7 years, 8 months ago
Reviewers:
Robert Sesek
CC:
chromium-reviews, sail+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Added a StringDescription() function to safely print object pointers that may be nil. If expected or actual is nil, calling [[obj description] UTF8String] returns nil and results in a call to std::string constructor with a nil pointer. This causes a C++ exception. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=191439

Patch Set 1 #

Patch Set 2 : fixed indentation #

Total comments: 2

Patch Set 3 : obj is enough #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -4 lines) Patch
M testing/gtest_mac.mm View 1 2 3 chunks +10 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
pkl (ping after 24h if needed)
7 years, 8 months ago (2013-03-29 16:32:32 UTC) #1
Robert Sesek
https://codereview.chromium.org/13318003/diff/2001/testing/gtest_mac.mm File testing/gtest_mac.mm (right): https://codereview.chromium.org/13318003/diff/2001/testing/gtest_mac.mm#newcode23 testing/gtest_mac.mm:23: return [[NSString stringWithFormat:@"%@", [obj description]] UTF8String]; Just pass |obj| ...
7 years, 8 months ago (2013-03-29 16:33:59 UTC) #2
pkl (ping after 24h if needed)
https://codereview.chromium.org/13318003/diff/2001/testing/gtest_mac.mm File testing/gtest_mac.mm (right): https://codereview.chromium.org/13318003/diff/2001/testing/gtest_mac.mm#newcode23 testing/gtest_mac.mm:23: return [[NSString stringWithFormat:@"%@", [obj description]] UTF8String]; On 2013/03/29 16:33:59, ...
7 years, 8 months ago (2013-03-29 16:38:45 UTC) #3
Robert Sesek
LGTM
7 years, 8 months ago (2013-03-29 16:39:06 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkl@chromium.org/13318003/7002
7 years, 8 months ago (2013-03-29 16:41:35 UTC) #5
commit-bot: I haz the power
7 years, 8 months ago (2013-03-29 20:17:06 UTC) #6
Message was sent while issue was closed.
Change committed as 191439

Powered by Google App Engine
This is Rietveld 408576698