Browse Source

IOSAD-172 Rename internal constructor

IOSAD-172
Dirk Zimmermann 1 year ago
parent
commit
93ece00357
3 changed files with 9 additions and 10 deletions
  1. +5
    -6
      pEpObjCAdapter/PEPPassphraseCache.m
  2. +2
    -2
      pEpObjCAdapter/PEPPassphraseCacheInternal.h
  3. +2
    -2
      pEpObjCTests/PEPPassphraseCacheTest.m

+ 5
- 6
pEpObjCAdapter/PEPPassphraseCache.m View File

@ -14,7 +14,7 @@
static NSUInteger s_maxNumberOfPassphrases = 20;
static NSTimeInterval s_defaultTimeoutInSeconds = 10 * 60;
static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
static NSTimeInterval s_defaultCheckExpiryInterval = 60;
@interface PEPPassphraseCache ()
@ -26,8 +26,8 @@ static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
@implementation PEPPassphraseCache
/// Internal constructor (for now).
- (instancetype)initWithTimeout:(NSTimeInterval)timeout
removeStalePassphrasesInterval:(NSTimeInterval)removeStalePassphrasesInterval
- (instancetype)initWithPassphraseTimeout:(NSTimeInterval)timeout
checkExpiryInterval:(NSTimeInterval)checkExpiryInterval
{
self = [super init];
if (self) {
@ -41,9 +41,8 @@ static NSTimeInterval s_defaultRemoveStalePassphrasesInterval = 60;
/// Public constructor with default values.
- (instancetype)init
{
return [self
initWithTimeout:s_defaultTimeoutInSeconds
removeStalePassphrasesInterval:s_defaultRemoveStalePassphrasesInterval];
return [self initWithPassphraseTimeout:s_defaultTimeoutInSeconds
checkExpiryInterval:s_defaultCheckExpiryInterval];
}
- (void)addPassphrase:(NSString *)passphrase


+ 2
- 2
pEpObjCAdapter/PEPPassphraseCacheInternal.h View File

@ -12,8 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface PEPPassphraseCache (internal)
- (instancetype)initWithTimeout:(NSTimeInterval)timeout
removeStalePassphrasesInterval:(NSTimeInterval)removeStalePassphrasesInterval;
- (instancetype)initWithPassphraseTimeout:(NSTimeInterval)timeout
checkExpiryInterval:(NSTimeInterval)checkExpiryInterval;
@end


+ 2
- 2
pEpObjCTests/PEPPassphraseCacheTest.m View File

@ -91,8 +91,8 @@
{
NSTimeInterval timeout = 0.5;
PEPPassphraseCache *ownCache = [[PEPPassphraseCache alloc]
initWithTimeout:timeout
removeStalePassphrasesInterval:timeout];
initWithPassphraseTimeout:timeout
checkExpiryInterval:timeout];
NSString *ownPassphrase = @"blah";
[ownCache addPassphrase:ownPassphrase];


Loading…
Cancel
Save