This commit is contained in:
lawrencelomax 2016-01-27 15:31:42 +00:00
Родитель 33746d0a0b
Коммит 3e5f2f7f9a
2 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -157,7 +157,7 @@ static id<FBSimulatorLogger> logger;
+ (void)setDefaultLogger:(id<FBSimulatorLogger>)defaultLogger
{
if (logger) {
[logger logFormat:@"The Default logger has allready been set to %@, %@ will have no effect", logger, NSStringFromSelector(_cmd)];
[logger logFormat:@"The Default logger has already been set to %@, %@ will have no effect", logger, NSStringFromSelector(_cmd)];
}
logger = defaultLogger;
}
@ -165,7 +165,7 @@ static id<FBSimulatorLogger> logger;
+ (void)setDefaultLoggerToASLWithStderrLogging:(BOOL)stderrLogging debugLogging:(BOOL)debugLogging
{
if (logger) {
[logger logFormat:@"The Default logger has allready been set to %@, %@ will have no effect", logger, NSStringFromSelector(_cmd)];
[logger logFormat:@"The Default logger has already been set to %@, %@ will have no effect", logger, NSStringFromSelector(_cmd)];
}
setenv(FBSimulatorControlStderrLogging.UTF8String, stderrLogging ? "YES" : "NO", 1);
setenv(FBSimulatorControlDebugLogging.UTF8String, debugLogging ? "YES" : "NO", 1);

Просмотреть файл

@ -97,9 +97,10 @@ public func == (left: Command, right: Command) -> Bool {
extension Action : Equatable { }
public func == (left: Action, right: Action) -> Bool {
// The == function isn't as concise as it could be as Format? isn't automatically Equatable
// This is despite [Equatable] Equatable? and Format all being Equatable
switch (left, right) {
case (.Interact(let leftInteractions, let leftQuery, let leftMaybeFormat), .Interact(let rightInteractions, let rightQuery, let rightMaybeFormat)):
// This is a workaround for the fact that Swift doesn't play nice with Equatable nested two protocols deep.
if leftInteractions != rightInteractions || leftQuery != rightQuery {
return false
}
@ -111,8 +112,18 @@ public func == (left: Action, right: Action) -> Bool {
default:
return false
}
case (.Create(let leftConfiguration, _), .Create(let rightConfiguration, _)):
return leftConfiguration == rightConfiguration// && leftFormat == rightFormat
case (.Create(let leftConfiguration, let leftMaybeFormat), .Create(let rightConfiguration, let rightMaybeFormat)):
if leftConfiguration != rightConfiguration {
return false
}
switch (leftMaybeFormat, rightMaybeFormat) {
case (.Some(let leftFormat), .Some(let rightFormat)):
return leftFormat == rightFormat
case (.None, .None):
return true
default:
return false
}
default:
return true
}