Fix up tests

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 305541d03b
commit 7c62097d0c

@ -35,7 +35,7 @@ PODS:
- ProtocolBuffers (1.9.10)
- Reachability (3.2)
- SAMKeychain (1.5.0)
- SignalServiceKit (0.8.1):
- SignalServiceKit (0.9.0):
- '25519'
- AFNetworking
- AxolotlKit
@ -130,7 +130,7 @@ SPEC CHECKSUMS:
ProtocolBuffers: d088180c10072b3d24a9939a6314b7b9bcc2340b
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SAMKeychain: 1fc9ae02f576365395758b12888c84704eebc423
SignalServiceKit: 60f92ec89fbbf3196bd786b88f065c0214db9ca8
SignalServiceKit: 59a79a51b89b963ba94db30cc99ed5212da0bb9f
SocketRocket: 3f77ec2104cc113add553f817ad90a77114f5d43
SQLCipher: 4c768761421736a247ed6cf412d9045615d53dff
TwistedOakCollapsingFutures: f359b90f203e9ab13dfb92c9ff41842a7fe1cd0c

@ -1,9 +1,5 @@
//
// TSAttributesTest.m
// Signal
//
// Created by Michael Kirk on 6/27/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <XCTest/XCTest.h>
@ -30,13 +26,17 @@
- (void)testAttributesWithSignalingKey {
NSString *registrationId = [NSString stringWithFormat:@"%i", [TSAccountManager getOrGenerateRegistrationId]];
NSDictionary *expected = @{ @"AuthKey": @"fake-server-auth-token",
@"registrationId": registrationId,
@"signalingKey": @"fake-signaling-key",
@"voice": @1 };
NSDictionary *expected = @{
@"AuthKey" : @"fake-server-auth-token",
@"registrationId" : registrationId,
@"signalingKey" : @"fake-signaling-key",
@"video" : @1,
@"voice" : @1
};
NSDictionary *actual = [TSAttributes attributesWithSignalingKey:@"fake-signaling-key"
serverAuthToken:@"fake-server-auth-token"];
serverAuthToken:@"fake-server-auth-token"
isWebRTCEnabled:YES];
XCTAssertEqualObjects(expected, actual);
}

@ -1,4 +1,6 @@
// Copyright (c) 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "SignalRecipient.h"
#import "TSStorageManager+keyingMaterial.h"
@ -24,7 +26,10 @@
{
// Sanity Check
XCTAssertNotNil(self.localNumber);
[[[SignalRecipient alloc] initWithTextSecureIdentifier:self.localNumber relay:nil supportsVoice:YES] save];
[[[SignalRecipient alloc] initWithTextSecureIdentifier:self.localNumber
relay:nil
supportsVoice:YES
supportsWebRTC:YES] save];
XCTAssertNotNil([SignalRecipient recipientWithTextSecureIdentifier:self.localNumber]);
SignalRecipient *me = [SignalRecipient selfRecipient];

@ -1,5 +1,6 @@
// Created by Michael Kirk on 10/7/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "Cryptography.h"
#import "OWSDisappearingMessagesConfiguration.h"
@ -443,9 +444,15 @@ NS_ASSUME_NONNULL_BEGIN
NSData *groupIdData = [Cryptography generateRandomBytes:32];
SignalRecipient *successfulRecipient =
[[SignalRecipient alloc] initWithTextSecureIdentifier:@"successful-recipient-id" relay:nil supportsVoice:YES];
[[SignalRecipient alloc] initWithTextSecureIdentifier:@"successful-recipient-id"
relay:nil
supportsVoice:YES
supportsWebRTC:YES];
SignalRecipient *successfulRecipient2 =
[[SignalRecipient alloc] initWithTextSecureIdentifier:@"successful-recipient-id2" relay:nil supportsVoice:YES];
[[SignalRecipient alloc] initWithTextSecureIdentifier:@"successful-recipient-id2"
relay:nil
supportsVoice:YES
supportsWebRTC:YES];
TSGroupModel *groupModel = [[TSGroupModel alloc]
initWithTitle:@"group title"
@ -476,8 +483,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)testGetRecipients
{
SignalRecipient *recipient =
[[SignalRecipient alloc] initWithTextSecureIdentifier:@"fake-recipient-id" relay:nil supportsVoice:YES];
SignalRecipient *recipient = [[SignalRecipient alloc] initWithTextSecureIdentifier:@"fake-recipient-id"
relay:nil
supportsVoice:YES
supportsWebRTC:YES];
[recipient save];
OWSMessageSender *messageSender = self.successfulMessageSender;

@ -1,5 +1,6 @@
// Created by Michael Kirk on 10/7/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSFakeContactsUpdater.h"
#import "SignalRecipient.h"
@ -11,7 +12,10 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable SignalRecipient *)synchronousLookup:(NSString *)identifier error:(NSError **)error
{
NSLog(@"[OWSFakeContactsUpdater] Faking contact lookup.");
return [[SignalRecipient alloc] initWithTextSecureIdentifier:@"fake-recipient-id" relay:nil supportsVoice:YES];
return [[SignalRecipient alloc] initWithTextSecureIdentifier:@"fake-recipient-id"
relay:nil
supportsVoice:YES
supportsWebRTC:YES];
}
@end

Loading…
Cancel
Save