Skip to content

Commit

Permalink
Fix warnings with 32bit builds (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
crleona authored and Keqiu Hu committed Aug 23, 2019
1 parent e44e868 commit a454224
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
14 changes: 7 additions & 7 deletions LayoutTest.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'LayoutTest'
spec.version = '5.0.3'
spec.version = '5.0.4'
spec.license = { :type => 'Apache License, Version 2.0' }
spec.homepage = 'https://linkedin.github.io/LayoutTest-iOS'
spec.authors = 'LinkedIn'
Expand All @@ -16,18 +16,18 @@ Pod::Spec.new do |spec|

spec.subspec 'TestCase' do |sp|
sp.source_files = 'LayoutTest/TestCase'
sp.dependency 'LayoutTestBase/Autolayout', '5.0.3'
sp.dependency 'LayoutTestBase/Catalog', '5.0.3'
sp.dependency 'LayoutTestBase/Config', '5.0.3'
sp.dependency 'LayoutTestBase/Core', '5.0.3'
sp.dependency 'LayoutTestBase/UIViewHelpers', '5.0.3'
sp.dependency 'LayoutTestBase/Autolayout', '5.0.4'
sp.dependency 'LayoutTestBase/Catalog', '5.0.4'
sp.dependency 'LayoutTestBase/Config', '5.0.4'
sp.dependency 'LayoutTestBase/Core', '5.0.4'
sp.dependency 'LayoutTestBase/UIViewHelpers', '5.0.4'
sp.framework = 'XCTest'
end

spec.subspec 'SwiftSubspec' do |sp|
sp.source_files = 'LayoutTest/Swift', 'LayoutTest/LayoutTest.h'
sp.dependency 'LayoutTest/TestCase'
sp.dependency 'LayoutTestBase/Swift', '5.0.3'
sp.dependency 'LayoutTestBase/Swift', '5.0.4'
end
end

2 changes: 1 addition & 1 deletion LayoutTest/TestCase/LYTLayoutTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ - (void)runLayoutTestsWithViewProvider:(Class)viewProvider

if (self.maxNumberOfCombinations != nil &&
numberOfCombinationsExecuted > self.maxNumberOfCombinations.integerValue) {
NSString *errorMessage = [NSString stringWithFormat:@"Max number of layout combinations (%ld) exceeded.", self.maxNumberOfCombinations.integerValue];
NSString *errorMessage = [NSString stringWithFormat:@"Max number of layout combinations (%ld) exceeded.", (long)self.maxNumberOfCombinations.integerValue];
[self failTest:errorMessage view:view];
}

Expand Down
2 changes: 1 addition & 1 deletion LayoutTestBase.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'LayoutTestBase'
spec.version = '5.0.3'
spec.version = '5.0.4'
spec.license = { :type => 'Apache License, Version 2.0' }
spec.homepage = 'https://linkedin.github.io/LayoutTest-iOS'
spec.authors = 'LinkedIn'
Expand Down
2 changes: 1 addition & 1 deletion LayoutTestBase/Config/LYTConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)resetDefaults {
UIControl - Subclasses of UIControl should all have accessibility labels.
*/
self.viewClassesRequiringAccessibilityLabels = [NSSet setWithObjects:[UIControl class], nil];
self.cgFloatEpsilon = 1e-5;
self.cgFloatEpsilon = 1e-5f;
self.snapshotsToSavePerMethod = LYTSaveUnlimitedSnapshotsPerMethod;
}

Expand Down
36 changes: 18 additions & 18 deletions LayoutTestTests/FrameComparisonTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)testBeforeLeftToRight {
XCTAssertTrue([self.innerSubview1 lyt_before:self.innerSubview2]);
self.innerSubview1.lyt_left = -1;
XCTAssertTrue([self.innerSubview1 lyt_before:self.innerSubview2]);
self.innerSubview1.lyt_left = 0.0000001;
self.innerSubview1.lyt_left = 0.0000001f;
XCTAssertTrue([self.innerSubview1 lyt_before:self.innerSubview2]);
self.innerSubview1.lyt_left = 1;
XCTAssertTrue([self.innerSubview1 lyt_before:self.innerSubview2 fromCenter:YES]);
Expand All @@ -75,7 +75,7 @@ - (void)testBeforeRightToLeft {
XCTAssertTrue([self.innerSubview2 lyt_before:self.innerSubview1]);
self.innerSubview2.lyt_left = 6;
XCTAssertTrue([self.innerSubview2 lyt_before:self.innerSubview1]);
self.innerSubview2.lyt_left = 4.999999;
self.innerSubview2.lyt_left = 4.999999f;
XCTAssertTrue([self.innerSubview2 lyt_before:self.innerSubview1]);
self.innerSubview2.lyt_left = 8;
XCTAssertTrue([self.innerSubview2 lyt_before:self.innerSubview1 fromCenter:YES]);
Expand All @@ -102,7 +102,7 @@ - (void)testAfterLeftToRight {
XCTAssertTrue([self.innerSubview2 lyt_after:self.innerSubview1]);
self.innerSubview2.lyt_left = 6;
XCTAssertTrue([self.innerSubview2 lyt_after:self.innerSubview1]);
self.innerSubview2.lyt_left = 4.999999;
self.innerSubview2.lyt_left = 4.999999f;
XCTAssertTrue([self.innerSubview2 lyt_after:self.innerSubview1]);
self.innerSubview2.lyt_left = 4;
XCTAssertTrue([self.innerSubview2 lyt_after:self.innerSubview1 fromCenter:TRUE]);
Expand All @@ -128,7 +128,7 @@ - (void)testAfterRightToLeft {
XCTAssertTrue([self.innerSubview1 lyt_after:self.innerSubview2]);
self.innerSubview1.lyt_left = -1;
XCTAssertTrue([self.innerSubview1 lyt_after:self.innerSubview2]);
self.innerSubview1.lyt_left = 0.0000001;
self.innerSubview1.lyt_left = 0.0000001f;
XCTAssertTrue([self.innerSubview1 lyt_after:self.innerSubview2]);
self.innerSubview1.lyt_left = 2;
XCTAssertTrue([self.innerSubview1 lyt_after:self.innerSubview2 fromCenter:YES]);
Expand All @@ -154,7 +154,7 @@ - (void)testAbove {
XCTAssertTrue([self.innerSubview1 lyt_above:self.innerSubview2]);
self.innerSubview1.lyt_top = -1;
XCTAssertTrue([self.innerSubview1 lyt_above:self.innerSubview2]);
self.innerSubview1.lyt_top = 0.000001;
self.innerSubview1.lyt_top = 0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_above:self.innerSubview2]);

// Failure expected
Expand All @@ -174,7 +174,7 @@ - (void)testBelow {
XCTAssertTrue([self.innerSubview2 lyt_below:self.innerSubview1]);
self.innerSubview2.lyt_top = 6;
XCTAssertTrue([self.innerSubview2 lyt_below:self.innerSubview1]);
self.innerSubview2.lyt_top = 4.999999;
self.innerSubview2.lyt_top = 4.999999f;
XCTAssertTrue([self.innerSubview2 lyt_below:self.innerSubview1]);

// Failure expected
Expand All @@ -197,10 +197,10 @@ - (void)testAlignStartLeftToRight {
self.innerSubview2.lyt_left = 0;
XCTAssertTrue([self.innerSubview1 lyt_leadingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_leadingAligned:self.innerSubview1]);
self.innerSubview2.lyt_left = 0.000001;
self.innerSubview2.lyt_left = 0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_leadingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_leadingAligned:self.innerSubview1]);
self.innerSubview2.lyt_left = -0.000001;
self.innerSubview2.lyt_left = -0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_leadingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_leadingAligned:self.innerSubview1]);

Expand All @@ -225,10 +225,10 @@ - (void)testAlignStartRightToLeft {
self.innerSubview2.lyt_right = 5;
XCTAssertTrue([self.innerSubview1 lyt_leadingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_leadingAligned:self.innerSubview1]);
self.innerSubview2.lyt_right = 5.000001;
self.innerSubview2.lyt_right = 5.000001f;
XCTAssertTrue([self.innerSubview1 lyt_leadingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_leadingAligned:self.innerSubview1]);
self.innerSubview2.lyt_right = 4.999999;
self.innerSubview2.lyt_right = 4.999999f;
XCTAssertTrue([self.innerSubview1 lyt_leadingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_leadingAligned:self.innerSubview1]);

Expand All @@ -253,10 +253,10 @@ - (void)testAlignEnd {
self.innerSubview2.lyt_right = 5;
XCTAssertTrue([self.innerSubview1 lyt_trailingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_trailingAligned:self.innerSubview1]);
self.innerSubview2.lyt_right = 5.000001;
self.innerSubview2.lyt_right = 5.000001f;
XCTAssertTrue([self.innerSubview1 lyt_trailingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_trailingAligned:self.innerSubview1]);
self.innerSubview2.lyt_right = 4.999999;
self.innerSubview2.lyt_right = 4.999999f;
XCTAssertTrue([self.innerSubview1 lyt_trailingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_trailingAligned:self.innerSubview1]);

Expand All @@ -281,10 +281,10 @@ - (void)testAlignEndRightToLeft {
self.innerSubview2.lyt_left = 0;
XCTAssertTrue([self.innerSubview1 lyt_trailingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_trailingAligned:self.innerSubview1]);
self.innerSubview2.lyt_left = 0.000001;
self.innerSubview2.lyt_left = 0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_trailingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_trailingAligned:self.innerSubview1]);
self.innerSubview2.lyt_left = -0.000001;
self.innerSubview2.lyt_left = -0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_trailingAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_trailingAligned:self.innerSubview1]);

Expand All @@ -309,10 +309,10 @@ - (void)testAlignTop {
self.innerSubview2.lyt_top = 0;
XCTAssertTrue([self.innerSubview1 lyt_topAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_topAligned:self.innerSubview1]);
self.innerSubview2.lyt_top = 0.000001;
self.innerSubview2.lyt_top = 0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_topAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_topAligned:self.innerSubview1]);
self.innerSubview2.lyt_top = -0.000001;
self.innerSubview2.lyt_top = -0.000001f;
XCTAssertTrue([self.innerSubview1 lyt_topAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_topAligned:self.innerSubview1]);

Expand All @@ -336,10 +336,10 @@ - (void)testAlignBottom {
self.innerSubview2.lyt_bottom = 5;
XCTAssertTrue([self.innerSubview1 lyt_bottomAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_bottomAligned:self.innerSubview1]);
self.innerSubview2.lyt_bottom = 5.000001;
self.innerSubview2.lyt_bottom = 5.000001f;
XCTAssertTrue([self.innerSubview1 lyt_bottomAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_bottomAligned:self.innerSubview1]);
self.innerSubview2.lyt_bottom = 4.999999;
self.innerSubview2.lyt_bottom = 4.999999f;
XCTAssertTrue([self.innerSubview1 lyt_bottomAligned:self.innerSubview2]);
XCTAssertTrue([self.innerSubview2 lyt_bottomAligned:self.innerSubview1]);

Expand Down
22 changes: 11 additions & 11 deletions LayoutTestTests/TestHelpersTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ - (void)testWithinSuperviewBoundsBottom {
}

- (void)testWithinSuperviewBoundsUpperEpsilon {
self.subview.lyt_top = -0.0000001;
self.subview.lyt_top = -0.0000001f;

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertViewWithinSuperViewBounds:^(__unused NSString *error, __unused UIView *view) {
Expand All @@ -153,7 +153,7 @@ - (void)testWithinSuperviewBoundsUpperEpsilon {
}

- (void)testWithinSuperviewBoundsLeftEpsilon {
self.subview.lyt_left = -0.0000001;
self.subview.lyt_left = -0.0000001f;

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertViewWithinSuperViewBounds:^(__unused NSString *error, __unused UIView *view) {
Expand All @@ -171,7 +171,7 @@ - (void)testWithinSuperviewBoundsLeftEpsilon {
}

- (void)testWithinSuperviewBoundsRightEpsilon {
self.subview.lyt_left = 0.0000001;
self.subview.lyt_left = 0.0000001f;

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertViewWithinSuperViewBounds:^(__unused NSString *error, __unused UIView *view) {
Expand All @@ -189,7 +189,7 @@ - (void)testWithinSuperviewBoundsRightEpsilon {
}

- (void)testWithinSuperviewBoundsBottomEpsilon {
self.subview.lyt_top = 0.0000001;
self.subview.lyt_top = 0.0000001f;

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertViewWithinSuperViewBounds:^(__unused NSString *error, __unused UIView *view) {
Expand Down Expand Up @@ -304,8 +304,8 @@ - (void)testOverlapBottomLeft {
}

- (void)testOverlapTopRightEpsilon {
self.innerSubview1.frame = CGRectMake(0, 5, 5.0000001, 5);
self.innerSubview2.frame = CGRectMake(5, 0, 5, 5.0000001);
self.innerSubview1.frame = CGRectMake(0.0f, 5.0f, 5.0000001f, 5.0f);
self.innerSubview2.frame = CGRectMake(5.0f, 0.0f, 5.0f, 5.0000001f);

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertNoSubviewsOverlap:^(__unused NSString *error, UIView *view1, UIView *view2) {
Expand All @@ -327,8 +327,8 @@ - (void)testOverlapTopRightEpsilon {
}

- (void)testOverlapTopLeftEpsilon {
self.innerSubview1.frame = CGRectMake(5, 5, 5, 5);
self.innerSubview2.frame = CGRectMake(0, 0, 5.0000001, 5.0000001);
self.innerSubview1.frame = CGRectMake(5.0f, 5.0f, 5.0f, 5.0f);
self.innerSubview2.frame = CGRectMake(0.0f, 0.0f, 5.0000001f, 5.0000001f);

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertNoSubviewsOverlap:^(__unused NSString *error, UIView *view1, UIView *view2) {
Expand All @@ -351,7 +351,7 @@ - (void)testOverlapTopLeftEpsilon {
}

- (void)testOverlapBottomRightEpsilon {
self.innerSubview1.frame = CGRectMake(0, 0, 5.0000001, 5.0000001);
self.innerSubview1.frame = CGRectMake(0, 0, 5.0000001f, 5.0000001f);
self.innerSubview2.frame = CGRectMake(5, 5, 5, 5);

__block NSInteger numberOfErrors = 0;
Expand All @@ -374,8 +374,8 @@ - (void)testOverlapBottomRightEpsilon {
}

- (void)testOverlapBottomLeftEpsilon {
self.innerSubview1.frame = CGRectMake(5, 0, 5, 5.0000001);
self.innerSubview2.frame = CGRectMake(0, 5, 5.0000001, 5);
self.innerSubview1.frame = CGRectMake(5.0f, 0.0f, 5.0f, 5.0000001f);
self.innerSubview2.frame = CGRectMake(0.0f, 5.0f, 5.0000001f, 5.0f);

__block NSInteger numberOfErrors = 0;
[self.subview lyt_assertNoSubviewsOverlap:^(__unused NSString *error, UIView *view1, UIView *view2) {
Expand Down

0 comments on commit a454224

Please sign in to comment.