Ensure fakes/mocks are debug-only.

pull/1/head
Matthew Chen 7 years ago
parent ef12612a9c
commit 2ba642c9e9

@ -28,7 +28,7 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "1115976DB2D993FB7AAB33CEBB52F472" BlueprintIdentifier = "237277EA071A0C42090E0E10F34EFC45"
BuildableName = "SignalServiceKit.framework" BuildableName = "SignalServiceKit.framework"
BlueprintName = "SignalServiceKit" BlueprintName = "SignalServiceKit"
ReferencedContainer = "container:Pods/Pods.xcodeproj"> ReferencedContainer = "container:Pods/Pods.xcodeproj">
@ -56,7 +56,7 @@
skipped = "NO"> skipped = "NO">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "B50508FED0E49769CFCF3F5D7B5FCD61" BlueprintIdentifier = "11B0EF2E18D829262A7DF015BEBB0909"
BuildableName = "SignalServiceKit-Unit-Tests.xctest" BuildableName = "SignalServiceKit-Unit-Tests.xctest"
BlueprintName = "SignalServiceKit-Unit-Tests" BlueprintName = "SignalServiceKit-Unit-Tests"
ReferencedContainer = "container:Pods/Pods.xcodeproj"> ReferencedContainer = "container:Pods/Pods.xcodeproj">

@ -6,8 +6,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeCallMessageHandler : NSObject <OWSCallMessageHandler> @interface OWSFakeCallMessageHandler : NSObject <OWSCallMessageHandler>
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -1,37 +1,42 @@
// Created by Michael Kirk on 12/18/16. //
// Copyright © 2016 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSFakeCallMessageHandler.h" #import "OWSFakeCallMessageHandler.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@implementation OWSFakeCallMessageHandler @implementation OWSFakeCallMessageHandler
- (void)receivedOffer:(OWSSignalServiceProtosCallMessageOffer *)offer fromCallerId:(NSString *)callerId - (void)receivedOffer:(SSKProtoCallMessageOffer *)offer fromCallerId:(NSString *)callerId
{ {
NSLog(@"%s", __PRETTY_FUNCTION__); NSLog(@"%s", __PRETTY_FUNCTION__);
} }
- (void)receivedAnswer:(OWSSignalServiceProtosCallMessageAnswer *)answer fromCallerId:(NSString *)callerId - (void)receivedAnswer:(SSKProtoCallMessageAnswer *)answer fromCallerId:(NSString *)callerId
{ {
NSLog(@"%s", __PRETTY_FUNCTION__); NSLog(@"%s", __PRETTY_FUNCTION__);
} }
- (void)receivedIceUpdate:(OWSSignalServiceProtosCallMessageIceUpdate *)iceUpdate fromCallerId:(NSString *)callerId - (void)receivedIceUpdate:(SSKProtoCallMessageIceUpdate *)iceUpdate fromCallerId:(NSString *)callerId
{ {
NSLog(@"%s", __PRETTY_FUNCTION__); NSLog(@"%s", __PRETTY_FUNCTION__);
} }
- (void)receivedHangup:(OWSSignalServiceProtosCallMessageHangup *)hangup fromCallerId:(NSString *)callerId - (void)receivedHangup:(SSKProtoCallMessageHangup *)hangup fromCallerId:(NSString *)callerId
{ {
NSLog(@"%s", __PRETTY_FUNCTION__); NSLog(@"%s", __PRETTY_FUNCTION__);
} }
- (void)receivedBusy:(OWSSignalServiceProtosCallMessageBusy *)busy fromCallerId:(NSString *)callerId - (void)receivedBusy:(SSKProtoCallMessageBusy *)busy fromCallerId:(NSString *)callerId
{ {
NSLog(@"%s", __PRETTY_FUNCTION__); NSLog(@"%s", __PRETTY_FUNCTION__);
} }
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,8 +6,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeContactsManager : NSObject <ContactsManagerProtocol> @interface OWSFakeContactsManager : NSObject <ContactsManagerProtocol>
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class UIImage; #ifdef DEBUG
@implementation OWSFakeContactsManager @implementation OWSFakeContactsManager
@ -37,4 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,6 +6,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeMessageSender : OWSMessageSender @interface OWSFakeMessageSender : OWSMessageSender
@property (nonatomic, nullable) dispatch_block_t enqueueMessageBlock; @property (nonatomic, nullable) dispatch_block_t enqueueMessageBlock;
@ -14,4 +16,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,6 +6,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@implementation OWSFakeMessageSender @implementation OWSFakeMessageSender
- (void)enqueueMessage:(TSOutgoingMessage *)message - (void)enqueueMessage:(TSOutgoingMessage *)message
@ -46,4 +48,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,10 +6,14 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeNetworkManager : TSNetworkManager @interface OWSFakeNetworkManager : TSNetworkManager
- (instancetype)init; - (instancetype)init;
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,6 +6,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@implementation OWSFakeNetworkManager @implementation OWSFakeNetworkManager
- (void)makeRequest:(TSRequest *)request - (void)makeRequest:(TSRequest *)request
@ -17,4 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,8 +6,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeNotificationsManager : NSObject <NotificationsProtocol> @interface OWSFakeNotificationsManager : NSObject <NotificationsProtocol>
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,6 +6,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@implementation OWSFakeNotificationsManager @implementation OWSFakeNotificationsManager
- (void)notifyUserForIncomingMessage:(TSIncomingMessage *)incomingMessage - (void)notifyUserForIncomingMessage:(TSIncomingMessage *)incomingMessage
@ -23,4 +25,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,8 +6,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeProfileManager : NSObject <ProfileManagerProtocol> @interface OWSFakeProfileManager : NSObject <ProfileManagerProtocol>
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -8,6 +8,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface OWSFakeProfileManager () @interface OWSFakeProfileManager ()
@property (nonatomic, readonly) NSMutableDictionary<NSString *, OWSAES256Key *> *profileKeys; @property (nonatomic, readonly) NSMutableDictionary<NSString *, OWSAES256Key *> *profileKeys;
@ -68,4 +70,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -6,8 +6,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface TestAppContext : NSObject <AppContext> @interface TestAppContext : NSObject <AppContext>
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -7,6 +7,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface TestAppContext () @interface TestAppContext ()
@property (nonatomic) SSKTestKeychainStorage *testKeychainStorage; @property (nonatomic) SSKTestKeychainStorage *testKeychainStorage;
@ -150,4 +152,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -4,6 +4,8 @@
import Foundation import Foundation
#if DEBUG
@objc @objc
public class SSKTestKeychainStorage: NSObject, SSKKeychainStorage { public class SSKTestKeychainStorage: NSObject, SSKKeychainStorage {
@ -50,3 +52,5 @@ public class SSKTestKeychainStorage: NSObject, SSKKeychainStorage {
dataMap.removeValue(forKey: key) dataMap.removeValue(forKey: key)
} }
} }
#endif

@ -6,8 +6,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@interface SSKBaseTest : XCTestCase @interface SSKBaseTest : XCTestCase
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

@ -9,6 +9,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#ifdef DEBUG
@implementation SSKBaseTest @implementation SSKBaseTest
- (void)setUp - (void)setUp
@ -35,4 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
#endif
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

Loading…
Cancel
Save