avoid assertion when deliberately testing for failure
This commit is contained in:
parent
24668fa790
commit
2c44cbccfd
|
@ -286,7 +286,9 @@ public class OWSUDManagerImpl: NSObject, OWSUDManager {
|
|||
if isUDVerboseLoggingEnabled() {
|
||||
Logger.info("UD disabled for \(recipientId), no profile key for this recipient.")
|
||||
}
|
||||
owsFailDebug("Couldn't find profile key for UD-enabled user.")
|
||||
if (!CurrentAppContext().isRunningTests) {
|
||||
owsFailDebug("Couldn't find profile key for UD-enabled user.")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if isUDVerboseLoggingEnabled() {
|
||||
|
|
|
@ -50,4 +50,19 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
#endif
|
||||
|
||||
#define OWSFailDebugUnlessRunningTests(_messageFormat, ...) \
|
||||
do { \
|
||||
if (!CurrentAppContext().isRunningTests) { \
|
||||
OWSFailDebug(_messageFormat, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define OWSCFailDebugUnlessRunningTests(_messageFormat, ...) \
|
||||
do { \
|
||||
if (!CurrentAppContext().isRunningTests) { \
|
||||
OWSCFailDebug(_messageFormat, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (NO)
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
Loading…
Reference in New Issue