Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Replace big macro with Objective-C method for easier debugging. #180

Merged
merged 3 commits into from
Sep 22, 2016

Conversation

carsten-wenderdel
Copy link
Contributor

When something goes wrong, C macros are hard to debug. So I replaced the main macro with an Objective-C method.
The XCT asserts are still in the macro. So if they fail, Xcode will highlight them in the actual test class, not in FBSnapshotTestCase.

@nscoding
Copy link
Contributor

oh nice, that's a good addition. I'll review it in detail this week.

Copy link
Contributor

@nscoding nscoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments but this looks great.

- (NSString *)snapshotVerifyViewOrLayer:(id)viewOrLayer
identifier:(NSString *)identifier
suffixes:(NSOrderedSet *)suffixes
tolerance:(CGFloat)tolerance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent all parameters

suffixes:(NSOrderedSet *)suffixes
tolerance:(CGFloat)tolerance
{
NSString *referenceImageDirectory = [self getReferenceImageDirectoryWithDefault:(@ FB_REFERENCE_IMAGE_DIR)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add an assert that viewOrLayer is not nil

@pietbrauer
Copy link
Contributor

This would be great to see merged, especially since we could get rid of the Swift file and use the Objective-C public API instead or am I missing something?

@nscoding nscoding merged commit 6a3f71f into facebookarchive:master Sep 22, 2016
@nscoding nscoding mentioned this pull request Oct 6, 2016
thorthugnasty pushed a commit to thorthugnasty/ios-snapshot-test-case that referenced this pull request Jan 26, 2017
…t-case into andrewli/add-color-tolerance

* 'master' of https://github.com/facebook/ios-snapshot-test-case:
  Fix documentation warnings (facebookarchive#205)
  Add Reference to IMAGE_DIFF_DIR (facebookarchive#201)
  Update pod version and change log (facebookarchive#199)
  Bump version to 2.1.4 (facebookarchive#198)
  Replace big macro with Objective-C method for easier debugging. (facebookarchive#180)
  Merge Swift 3 in master (facebookarchive#194)
  Fix pod verification (facebookarchive#193)
  Bump version to 2.3 (facebookarchive#192)
  Revert "Merge Swift 3 into master" (facebookarchive#191)
  Merge Swift 3 into master (facebookarchive#189)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants