summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2016-07-29 11:38:02 -0700
committerMuller, Alexander (A.) <amulle19@ford.com>2016-07-29 11:38:02 -0700
commit10b8220fad2627e25b3560cf86e8ac1f15d81ea3 (patch)
tree94e22ed8991aad9bc41798eac5961f83151335ac
parente17cda81318d1bf6516fac4ab73b27b0d38e0cbc (diff)
downloadsdl_ios-10b8220fad2627e25b3560cf86e8ac1f15d81ea3.tar.gz
Fixed spec issue relating to changed default movementTimeThreshold.
-rw-r--r--SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m
index 2a3740e4c..21639b6b7 100644
--- a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m
+++ b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/SDLTouchManagerSpec.m
@@ -30,7 +30,7 @@ describe(@"SDLTouchManager Tests", ^{
expect(touchManager.touchEventDelegate).to(beNil());
expect(@(touchManager.tapDistanceThreshold)).to(equal(@50));
expect(@(touchManager.tapTimeThreshold)).to(beCloseTo(@0.4).within(0.0001));
- expect(@(touchManager.movementTimeThreshold)).to(beCloseTo(@0.5).within(0.0001));
+ expect(@(touchManager.movementTimeThreshold)).to(beCloseTo(@0.05).within(0.0001));
expect(@(touchManager.isTouchEnabled)).to(beTruthy());
});
@@ -336,7 +336,9 @@ describe(@"SDLTouchManager Tests", ^{
panStartTouchCoord.x = @(panStartPoint.x);
panStartTouchCoord.y = @(panStartPoint.y);
- NSUInteger panStartTimeStamp = ([[NSDate date] timeIntervalSince1970] + ((touchManager.movementTimeThreshold + .1) * 1000)) * 1000;
+ CGFloat movementTimeThresholdOffset = (touchManager.movementTimeThreshold + .01) * 1000;
+
+ NSUInteger panStartTimeStamp = ([[NSDate date] timeIntervalSince1970] * 1000) + movementTimeThresholdOffset;
SDLTouchEvent* panStartTouchEvent = [[SDLTouchEvent alloc] init];
panStartTouchEvent.coord = [NSMutableArray arrayWithObject:panStartTouchCoord];
@@ -353,7 +355,7 @@ describe(@"SDLTouchManager Tests", ^{
panMoveTouchCoord.x = @(panMovePoint.x);
panMoveTouchCoord.y = @(panMovePoint.y);
- NSUInteger panMoveTimeStamp = panStartTimeStamp + ((touchManager.movementTimeThreshold + .1) * 1000);
+ NSUInteger panMoveTimeStamp = panStartTimeStamp + movementTimeThresholdOffset;
SDLTouchEvent* panMoveTouchEvent = [[SDLTouchEvent alloc] init];
panMoveTouchEvent.coord = [NSMutableArray arrayWithObject:panMoveTouchCoord];
@@ -370,7 +372,7 @@ describe(@"SDLTouchManager Tests", ^{
panSecondMoveTouchCoord.x = @(panSecondMovePoint.x);
panSecondMoveTouchCoord.y = @(panSecondMovePoint.y);
- NSUInteger panSecondMoveTimeStamp = panMoveTimeStamp + ((touchManager.movementTimeThreshold + .1) * 1000);
+ NSUInteger panSecondMoveTimeStamp = panMoveTimeStamp + movementTimeThresholdOffset;
SDLTouchEvent* panSecondMoveTouchEvent = [[SDLTouchEvent alloc] init];
panSecondMoveTouchEvent.coord = [NSMutableArray arrayWithObject:panSecondMoveTouchCoord];
@@ -387,7 +389,7 @@ describe(@"SDLTouchManager Tests", ^{
panEndTouchCoord.x = @(panEndPoint.x);
panEndTouchCoord.y = @(panEndPoint.y);
- NSUInteger panEndTimeStamp = panSecondMoveTimeStamp + ((touchManager.movementTimeThreshold + .1) * 1000);
+ NSUInteger panEndTimeStamp = panSecondMoveTimeStamp + movementTimeThresholdOffset;
SDLTouchEvent* panEndTouchEvent = [[SDLTouchEvent alloc] init];
panEndTouchEvent.coord = [NSMutableArray arrayWithObject:panEndTouchCoord];