diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2019-09-18 11:59:33 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2019-09-18 11:59:33 -0400 |
commit | 0d1ffd85343ec87200434dddd48c2d33577d640e (patch) | |
tree | ab2ae32afb32249df2b601fb800cb10296576fd5 | |
parent | 606e269cd39a377b331c7c4c74b8d6d03af3711c (diff) | |
download | sdl_ios-0d1ffd85343ec87200434dddd48c2d33577d640e.tar.gz |
Fix a bunch of the test errors and update snapshot test type
14 files changed, 18 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index 0a2349bb6..7c09c4f82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ before_script: - carthage bootstrap --platform ios script: -- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone 8" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c; -- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-ObjC" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone 8" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; -- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-Swift" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone 8" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; +- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone Xs" -configuration Debug ONLY_ACTIVE_ARCH=NO RUN_CLANG_STATIC_ANALYZER=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES ENABLE_TESTABILITY=YES test | xcpretty -c; +- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-ObjC" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone Xs" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; +- set -o pipefail && xcodebuild -project "SmartDeviceLink-iOS.xcodeproj" -scheme "SmartDeviceLink-Example-Swift" -sdk "iphonesimulator12.4" -destination "OS=12.4,name=iPhone Xs" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; after_script: - bash <(curl -s https://codecov.io/bash) diff --git a/SmartDeviceLink/SDLLockScreenConfiguration.m b/SmartDeviceLink/SDLLockScreenConfiguration.m index 47e4980de..c5cdfa8e6 100644 --- a/SmartDeviceLink/SDLLockScreenConfiguration.m +++ b/SmartDeviceLink/SDLLockScreenConfiguration.m @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN _displayMode = mode; _enableAutomaticLockScreen = (mode == SDLLockScreenConfigurationDisplayModeNever) ? NO : YES; - _showInOptionalState = (mode == SDLLockScreenConfigurationDisplayModeOptionalOrRequired) ? NO : YES; + _showInOptionalState = (mode == SDLLockScreenConfigurationDisplayModeOptionalOrRequired) ? YES : NO; _enableDismissGesture = enableDismissGesture; _backgroundColor = backgroundColor; @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN } + (instancetype)disabledConfiguration { - return [[self alloc] initWithDisplayMode:SDLLockScreenConfigurationDisplayModeNever enableDismissGesture:NO showDeviceLogo:YES backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; + return [[self alloc] initWithDisplayMode:SDLLockScreenConfigurationDisplayModeNever enableDismissGesture:NO showDeviceLogo:NO backgroundColor:[self sdl_defaultBackgroundColor] appIcon:nil viewController:nil]; } + (instancetype)enabledConfiguration { diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m index 5cb8377f4..ea80c0db6 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLFileManagerSpec.m @@ -875,7 +875,7 @@ describe(@"uploading/deleting multiple files in the file manager", ^{ [testFileManager uploadArtworks:testArtworks progressHandler:^BOOL(NSString * _Nonnull artworkName, float uploadPercentage, NSError * _Nullable error) { artworksDone++; expect(artworkName).to(equal(expectedArtworkNames[artworksDone - 1])); - expect(uploadPercentage).to(beCloseTo((float)artworksDone / 200.0)); + expect(uploadPercentage).to(beCloseTo((float)artworksDone / 200.0).within(0.1)); expect(error).to(beNil()); return YES; } completionHandler:^(NSArray<NSString *> * _Nonnull artworkNames, NSError * _Nullable error) { diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m index d35717658..2963efb96 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLockScreenConfigurationSpec.m @@ -14,8 +14,11 @@ describe(@"a lock screen configuration", ^{ }); it(@"should properly set properties", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testConfig.enableAutomaticLockScreen).to(beFalse()); expect(testConfig.showInOptionalState).to(beFalse()); +#pragma clang diagnostic pop expect(testConfig.enableDismissGesture).to(beFalse()); expect(testConfig.showDeviceLogo).to(beFalse()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); @@ -30,8 +33,11 @@ describe(@"a lock screen configuration", ^{ }); it(@"should properly set properties", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testConfig.enableAutomaticLockScreen).to(beTrue()); expect(testConfig.showInOptionalState).to(beFalse()); +#pragma clang diagnostic pop expect(testConfig.enableDismissGesture).to(beTrue()); expect(testConfig.showDeviceLogo).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); @@ -52,8 +58,11 @@ describe(@"a lock screen configuration", ^{ }); it(@"should properly set properties", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testConfig.enableAutomaticLockScreen).to(beTrue()); expect(testConfig.showInOptionalState).to(beFalse()); +#pragma clang diagnostic pop expect(testConfig.enableDismissGesture).to(beTrue()); expect(testConfig.showDeviceLogo).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor blueColor])); @@ -72,8 +81,11 @@ describe(@"a lock screen configuration", ^{ }); it(@"should properly set properties", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testConfig.enableAutomaticLockScreen).to(beTrue()); expect(testConfig.showInOptionalState).to(beFalse()); +#pragma clang diagnostic pop expect(testConfig.enableDismissGesture).to(beTrue()); expect(testConfig.showDeviceLogo).to(beTrue()); expect(testConfig.backgroundColor).to(equal([UIColor colorWithRed:(57.0/255.0) green:(78.0/255.0) blue:(96.0/255.0) alpha:1.0])); diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testAppAndVehicleIcons@2x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testAppAndVehicleIcons@2x.png Binary files differdeleted file mode 100644 index 935e31a1b..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testAppAndVehicleIcons@2x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testAppAndVehicleIcons_iPhone11_4_0x0@3x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testAppAndVehicleIcons_iPhone11_4_0x0@3x.png Binary files differdeleted file mode 100644 index 3b7684a62..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testAppAndVehicleIcons_iPhone11_4_0x0@3x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testLightBackgroundNoAppNoVehicleIcons@2x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testLightBackgroundNoAppNoVehicleIcons@2x.png Binary files differdeleted file mode 100644 index 935e31a1b..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testLightBackgroundNoAppNoVehicleIcons@2x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testLightBackgroundNoAppNoVehicleIcons_iPhone11_4_0x0@3x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testLightBackgroundNoAppNoVehicleIcons_iPhone11_4_0x0@3x.png Binary files differdeleted file mode 100644 index 3b7684a62..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testLightBackgroundNoAppNoVehicleIcons_iPhone11_4_0x0@3x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testNoAppNoVehicleIcons@2x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testNoAppNoVehicleIcons@2x.png Binary files differdeleted file mode 100644 index 935e31a1b..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testNoAppNoVehicleIcons@2x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testNoAppNoVehicleIcons_iPhone11_4_0x0@3x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testNoAppNoVehicleIcons_iPhone11_4_0x0@3x.png Binary files differdeleted file mode 100644 index 3b7684a62..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testNoAppNoVehicleIcons_iPhone11_4_0x0@3x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyAppIcon@2x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyAppIcon@2x.png Binary files differdeleted file mode 100644 index 935e31a1b..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyAppIcon@2x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyAppIcon_iPhone11_4_0x0@3x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyAppIcon_iPhone11_4_0x0@3x.png Binary files differdeleted file mode 100644 index 3b7684a62..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyAppIcon_iPhone11_4_0x0@3x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyVehicleIcon@2x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyVehicleIcon@2x.png Binary files differdeleted file mode 100644 index 935e31a1b..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyVehicleIcon@2x.png +++ /dev/null diff --git a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyVehicleIcon_iPhone11_4_0x0@3x.png b/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyVehicleIcon_iPhone11_4_0x0@3x.png Binary files differdeleted file mode 100644 index 3b7684a62..000000000 --- a/SmartDeviceLinkTests/ReferenceImages_64/SDLLockScreenViewControllerSnapshotTests/testOnlyVehicleIcon_iPhone11_4_0x0@3x.png +++ /dev/null |