Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3137)

Issue 1743056: Add macros for asserting/expecting equality for ObjC objects.

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 9 months ago by Robert Sesek (Google)
Modified:
13 years, 9 months ago
Reviewers:
Mark Mentovai
CC:
googletestframework_googlegroups.com, mmentovai_google.com
Base URL:
http://googletest.googlecode.com/svn/trunk/
Visibility:
Public.

Description

This adds adds four macros when compiling using GTEST_OS_MAC: {ASSERT,EXPECT}_NS{NE,EQ}. These test ObjC objects using |-isEqual:| and prints failures using the |-description| selector. This allows for better debugging output with ObjC++ test cases. This also makes changes to the xcconfig files because linking to the Foundation framework on 10.4 while supporting 10.5 and i386/x64 requires special-casing. BUG=http://code.google.com/p/googletest/issues/detail?id=303 TEST=Covered by unit tests.

Patch Set 1 #

Patch Set 2 : whitespace #

Patch Set 3 : '' #

Total comments: 6

Patch Set 4 : Add NeFailure, address comments #

Patch Set 5 : Minor change to GTestMac.AssertNSEQ #

Total comments: 3

Patch Set 6 : Indention fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -4 lines) Patch
A include/gtest/gtest-mac.h View 1 2 3 1 chunk +77 lines, -0 lines 0 comments Download
M include/gtest/internal/gtest-internal.h View 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M src/gtest.cc View 4 5 1 chunk +18 lines, -0 lines 0 comments Download
A src/gtest-mac.mm View 1 2 3 4 5 1 chunk +80 lines, -0 lines 0 comments Download
A test/gtest_mac_test.mm View 1 2 3 4 1 chunk +82 lines, -0 lines 0 comments Download
M test/gtest_unittest.cc View 2 chunks +11 lines, -0 lines 0 comments Download
M xcode/Config/General.xcconfig View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M xcode/gtest.xcodeproj/project.pbxproj View 1 2 3 18 chunks +42 lines, -4 lines 0 comments Download

Messages

Total messages: 4
Robert Sesek (Google)
Requesting review for this patch. Thanks.
13 years, 9 months ago (2010-08-04 21:47:39 UTC) #1
Mark Mentovai
http://codereview.appspot.com/1743056/diff/5001/6002 File include/gtest/gtest-mac.h (right): http://codereview.appspot.com/1743056/diff/5001/6002#newcode71 include/gtest/gtest-mac.h:71: Extra blank line. http://codereview.appspot.com/1743056/diff/5001/6003 File src/gtest-mac.mm (right): http://codereview.appspot.com/1743056/diff/5001/6003#newcode73 src/gtest-mac.mm:73: ...
13 years, 9 months ago (2010-08-04 22:04:09 UTC) #2
Robert Sesek (Google)
I've addressed all comments. I added ::testing::internal::NeFailure() but I have not converted all other sites ...
13 years, 9 months ago (2010-08-04 23:56:26 UTC) #3
Mark Mentovai
13 years, 9 months ago (2010-08-05 00:31:24 UTC) #4
LGTM!

You should also get buy-in from a gtester. I can’t check this in.

http://codereview.appspot.com/1743056/diff/20001/21004
File include/gtest/internal/gtest-internal.h (right):

http://codereview.appspot.com/1743056/diff/20001/21004#newcode301
include/gtest/internal/gtest-internal.h:301: // where foo is 5 and bar is 5, we
have:
we? Know your reviewer!

http://codereview.appspot.com/1743056/diff/20001/21004#newcode303
include/gtest/internal/gtest-internal.h:303: //   Expected: (foo) != (bar),
actual: 5 vs 5
I wonder if it ever makes sense to print the actual values twice. The existing
stuff does, I think, right?

http://codereview.appspot.com/1743056/diff/20001/21006
File src/gtest-mac.mm (right):

http://codereview.appspot.com/1743056/diff/20001/21006#newcode52
src/gtest-mac.mm:52: if ([expected isEqual:actual]) {
Not enough indent in this function.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b