From 14734d68856abb8a6da12d5be3c401dd2f89bc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Mon, 29 Feb 2016 15:41:42 +0100 Subject: [PATCH] Add failing tests for cases where imagePath or processPath is nil --- .../HockeySDKTests/BITCrashReportTextFormatterTests.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Support/HockeySDKTests/BITCrashReportTextFormatterTests.m b/Support/HockeySDKTests/BITCrashReportTextFormatterTests.m index 918d4b6a37..f3e465e825 100644 --- a/Support/HockeySDKTests/BITCrashReportTextFormatterTests.m +++ b/Support/HockeySDKTests/BITCrashReportTextFormatterTests.m @@ -44,16 +44,22 @@ // Test with default OS X app path processPath = [appBundlePath stringByAppendingString:@"/Contents/MacOS/MyApp"]; [self testOSXNonAppSpecificImagesForProcessPath:processPath]; + [self assertIsOtherWithImagePath:processPath processPath:nil]; + [self assertIsOtherWithImagePath:nil processPath:processPath]; [self assertIsAppBinaryWithImagePath:processPath processPath:processPath]; // Test with OS X LoginItems app helper path processPath = [appBundlePath stringByAppendingString:@"/Contents/Library/LoginItems/net.hockeyapp.helper.app/Contents/MacOS/Helper"]; [self testOSXNonAppSpecificImagesForProcessPath:processPath]; + [self assertIsOtherWithImagePath:processPath processPath:nil]; + [self assertIsOtherWithImagePath:nil processPath:processPath]; [self assertIsAppBinaryWithImagePath:processPath processPath:processPath]; // Test with OS X app in Resources folder processPath = @"/Applications/MyTestApp.App/Contents/Resources/Helper"; [self testOSXNonAppSpecificImagesForProcessPath:processPath]; + [self assertIsOtherWithImagePath:processPath processPath:nil]; + [self assertIsOtherWithImagePath:nil processPath:processPath]; [self assertIsAppBinaryWithImagePath:processPath processPath:processPath]; } @@ -66,6 +72,8 @@ // Test with iOS App processPath = [appBundlePath stringByAppendingString:@"/MyApp"]; [self testiOSNonAppSpecificImagesForProcessPath:processPath]; + [self assertIsOtherWithImagePath:processPath processPath:nil]; + [self assertIsOtherWithImagePath:nil processPath:processPath]; [self assertIsAppBinaryWithImagePath:processPath processPath:processPath]; [self testiOSAppFrameworkAtProcessPath:processPath appBundlePath:appBundlePath]; @@ -73,6 +81,8 @@ // Test with iOS App Extension processPath = [appBundlePath stringByAppendingString:@"/Plugins/MyAppExtension.appex/MyAppExtension"]; [self testiOSNonAppSpecificImagesForProcessPath:processPath]; + [self assertIsOtherWithImagePath:processPath processPath:nil]; + [self assertIsOtherWithImagePath:nil processPath:processPath]; [self assertIsAppBinaryWithImagePath:processPath processPath:processPath]; [self testiOSAppFrameworkAtProcessPath:processPath appBundlePath:appBundlePath]; }