Skip to content

Commit

Permalink
Skip all tests except "test__200__Presence__PresenceMap..."
Browse files Browse the repository at this point in the history
  • Loading branch information
maratal committed Feb 22, 2024
1 parent fb01ab8 commit 861920f
Show file tree
Hide file tree
Showing 38 changed files with 984 additions and 984 deletions.
2 changes: 1 addition & 1 deletion Test/Tests/ARTDefaultTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Ably.ARTDefault // System under Test

class ARTDefaultTests: XCTestCase {

func testVersions() {
func x_testVersions() {
XCTAssertEqual(ARTDefault.apiVersion(), "2")
XCTAssertEqual(ARTDefault.libraryVersion(), "1.2.24")
}
Expand Down
12 changes: 6 additions & 6 deletions Test/Tests/ARTInternalLogTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @interface ARTInternalLogTests : XCTestCase

@implementation ARTInternalLogTests

- (void)test_classMethodLogger {
- (void)x_test_classMethodLogger {
ARTInternalLog *const logger = ARTInternalLog.sharedClassMethodLogger_readDocumentationBeforeUsing;

XCTAssertTrue([logger.core isKindOfClass:[ARTDefaultInternalLogCore class]]);
Expand All @@ -23,7 +23,7 @@ - (void)test_classMethodLogger {
XCTAssertEqual(logAdapter.logger.logLevel, ARTLogLevelNone);
}

- (void)test_ARTLogVerbose {
- (void)x_test_ARTLogVerbose {
ARTMockInternalLogCore *const mock = [[ARTMockInternalLogCore alloc] init];
mock.logLevel = ARTLogLevelVerbose;
ARTInternalLog *const internalLog = [[ARTInternalLog alloc] initWithCore:mock];
Expand All @@ -38,7 +38,7 @@ - (void)test_ARTLogVerbose {
XCTAssertEqual(mock.lastReceivedLogMessageArgumentLine, statementLine);
}

- (void)test_ARTLogDebug {
- (void)x_test_ARTLogDebug {
ARTMockInternalLogCore *const mock = [[ARTMockInternalLogCore alloc] init];
mock.logLevel = ARTLogLevelDebug;
ARTInternalLog *const internalLog = [[ARTInternalLog alloc] initWithCore:mock];
Expand All @@ -53,7 +53,7 @@ - (void)test_ARTLogDebug {
XCTAssertEqual(mock.lastReceivedLogMessageArgumentLine, statementLine);
}

- (void)test_ARTLogInfo {
- (void)x_test_ARTLogInfo {
ARTMockInternalLogCore *const mock = [[ARTMockInternalLogCore alloc] init];
mock.logLevel = ARTLogLevelInfo;
ARTInternalLog *const internalLog = [[ARTInternalLog alloc] initWithCore:mock];
Expand All @@ -68,7 +68,7 @@ - (void)test_ARTLogInfo {
XCTAssertEqual(mock.lastReceivedLogMessageArgumentLine, statementLine);
}

- (void)test_ARTLogWarn {
- (void)x_test_ARTLogWarn {
ARTMockInternalLogCore *const mock = [[ARTMockInternalLogCore alloc] init];
mock.logLevel = ARTLogLevelWarn;
ARTInternalLog *const internalLog = [[ARTInternalLog alloc] initWithCore:mock];
Expand All @@ -83,7 +83,7 @@ - (void)test_ARTLogWarn {
XCTAssertEqual(mock.lastReceivedLogMessageArgumentLine, statementLine);
}

- (void)test_ARTLogError {
- (void)x_test_ARTLogError {
ARTMockInternalLogCore *const mock = [[ARTMockInternalLogCore alloc] init];
mock.logLevel = ARTLogLevelError;
ARTInternalLog *const internalLog = [[ARTInternalLog alloc] initWithCore:mock];
Expand Down
6 changes: 3 additions & 3 deletions Test/Tests/AttachRetryStateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import XCTest
import Ably.Private

class AttachRetryStateTests: XCTestCase {
func test_addRetryAttempt() {
func x_test_addRetryAttempt() {
// Given: an AttachRetryState initialized with a delay calculator that returns arbitrary values from its `delay(forRetryNumber:)` method...
let delays: [TimeInterval] = [0.1, 0.3, 0.9]
let calculator = MockRetryDelayCalculator(delays: delays)
Expand All @@ -22,7 +22,7 @@ class AttachRetryStateTests: XCTestCase {
XCTAssertEqual(thirdRetryAttempt.delay, delays[2])
}

func test_transitionToNonAttachingOrSuspendedStateResetsRetrySequence() {
func x_test_transitionToNonAttachingOrSuspendedStateResetsRetrySequence() {
// Given: an AttachRetryState initialized with a delay calculator that returns arbitrary values from its `delay(forRetryNumber:)` method...
let delays: [TimeInterval] = [0.1, 0.3, 0.9]
let calculator = MockRetryDelayCalculator(delays: delays)
Expand All @@ -40,7 +40,7 @@ class AttachRetryStateTests: XCTestCase {
XCTAssertEqual(retryAttempt.delay, delays[0])
}

func test_transitionToAttachingOrSuspendedStateDoesNotResetRetrySequence() {
func x_test_transitionToAttachingOrSuspendedStateDoesNotResetRetrySequence() {
// Given: an AttachRetryState initialized with a delay calculator that returns arbitrary values from its `delay(forRetryNumber:)` method...
let delays: [TimeInterval] = [0.1, 0.3, 0.9, 0.7]
let calculator = MockRetryDelayCalculator(delays: delays)
Expand Down
308 changes: 154 additions & 154 deletions Test/Tests/AuthTests.swift

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Test/Tests/BackoffRetryDelayCalculatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Ably
import XCTest

class BackoffRetryDelayCalculatorTests: XCTestCase {
func test_delay() {
func x_test_delay() {
let initialRetryTimeout = 0.5 // arbitrarily chosen

let jitterCoefficients = StaticJitterCoefficients()
Expand Down
6 changes: 3 additions & 3 deletions Test/Tests/ClientInformationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Ably
final class ClientInformationTests: XCTestCase {

// CR2, CR2a
func testAgents() {
func x_testAgents() {
let agents = ARTClientInformation.agents

XCTAssertEqual(agents.keys.count, 2)
Expand All @@ -25,7 +25,7 @@ final class ClientInformationTests: XCTestCase {
}

// CR3, CR3b
func testAgentIdentifierWithAdditionalAgents_withNilAdditionalAgents() {
func x_testAgentIdentifierWithAdditionalAgents_withNilAdditionalAgents() {
let expectedIdentifier = [
"ably-cocoa/1.2.24",
ARTDefault.platformAgent()
Expand All @@ -35,7 +35,7 @@ final class ClientInformationTests: XCTestCase {
}

// CR3, CR3b, CR3c
func testAgentIdentifierWithAdditionalAgents_withNonNilAdditionalAgents() {
func x_testAgentIdentifierWithAdditionalAgents_withNonNilAdditionalAgents() {
let additionalAgents = [
"demolib": "0.0.1",
"morelib": ARTClientInformationAgentNotVersioned
Expand Down
6 changes: 3 additions & 3 deletions Test/Tests/ConnectRetryStateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import XCTest
import Ably.Private

class ConnectRetryStateTests: XCTestCase {
func test_addRetryAttempt() {
func x_test_addRetryAttempt() {
// Given: an ConnectRetryState initialized with a delay calculator that returns arbitrary values from its `delay(forRetryNumber:)` method...
let delays: [TimeInterval] = [0.1, 0.3, 0.9]
let calculator = MockRetryDelayCalculator(delays: delays)
Expand All @@ -22,7 +22,7 @@ class ConnectRetryStateTests: XCTestCase {
XCTAssertEqual(thirdRetryAttempt.delay, delays[2])
}

func test_transitionToNonConnectingOrDisconnectedStateResetsRetrySequence() {
func x_test_transitionToNonConnectingOrDisconnectedStateResetsRetrySequence() {
// Given: an ConnectRetryState initialized with a delay calculator that returns arbitrary values from its `delay(forRetryNumber:)` method...
let delays: [TimeInterval] = [0.1, 0.3, 0.9]
let calculator = MockRetryDelayCalculator(delays: delays)
Expand All @@ -40,7 +40,7 @@ class ConnectRetryStateTests: XCTestCase {
XCTAssertEqual(retryAttempt.delay, delays[0])
}

func test_transitionToConnectingOrDisconnectedStateDoesNotResetRetrySequence() {
func x_test_transitionToConnectingOrDisconnectedStateDoesNotResetRetrySequence() {
// Given: an ConnectRetryState initialized with a delay calculator that returns arbitrary values from its `delay(forRetryNumber:)` method...
let delays: [TimeInterval] = [0.1, 0.3, 0.9, 0.7]
let calculator = MockRetryDelayCalculator(delays: delays)
Expand Down
4 changes: 2 additions & 2 deletions Test/Tests/ContinuousClockTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import XCTest
import Ably.Private

class ContinuousClockTests: XCTestCase {
func test_isAfter() {
func x_test_isAfter() {
let clock = ARTContinuousClock()

let preSleepNow = clock.now()
Expand All @@ -13,7 +13,7 @@ class ContinuousClockTests: XCTestCase {
XCTAssertTrue(postSleepNow.isAfter(preSleepNow))
}

func test_advancedBy() {
func x_test_advancedBy() {
let clock = ARTContinuousClock()

let preSleepNow = clock.now()
Expand Down
2 changes: 1 addition & 1 deletion Test/Tests/CryptoTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ @implementation CryptoTest
/**
Test encryption and decryption using a 256 bit key and varying lengths of data.
*/
-(void)testEncryptAndDecrypt {
-(void)x_testEncryptAndDecrypt {
// Configure the cipher.
const UInt8 keyBytes[] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
Expand Down
32 changes: 16 additions & 16 deletions Test/Tests/CryptoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CryptoTests: XCTestCase {
// RSE1

// RSE1a, RSE1b
func test__001__Crypto__getDefaultParams__returns_a_complete_CipherParams_instance__using_the_default_values_for_any_field_not_supplied() {
func x_test__001__Crypto__getDefaultParams__returns_a_complete_CipherParams_instance__using_the_default_values_for_any_field_not_supplied() {
expect { ARTCrypto.getDefaultParams(["nokey": "nokey"]) }.to(raiseException())

var params: ARTCipherParams = ARTCrypto.getDefaultParams([
Expand All @@ -42,24 +42,24 @@ class CryptoTests: XCTestCase {

// RSE1c

func test__004__Crypto__getDefaultParams__key_parameter__can_be_a_binary() {
func x_test__004__Crypto__getDefaultParams__key_parameter__can_be_a_binary() {
let params = ARTCrypto.getDefaultParams(["key": binaryKey])
XCTAssertEqual(params.key, binaryKey as Data)
}

func test__005__Crypto__getDefaultParams__key_parameter__can_be_a_base64_encoded_string_with_standard_encoding() {
func x_test__005__Crypto__getDefaultParams__key_parameter__can_be_a_base64_encoded_string_with_standard_encoding() {
let params = ARTCrypto.getDefaultParams(["key": key])
XCTAssertEqual(params.key, binaryKey as Data)
}

func test__006__Crypto__getDefaultParams__key_parameter__can_be_a_base64_encoded_string_with_URL_encoding() {
func x_test__006__Crypto__getDefaultParams__key_parameter__can_be_a_base64_encoded_string_with_URL_encoding() {
let key = "-_h4eHh4eHh4eHh4eHh4eA=="
let params = ARTCrypto.getDefaultParams(["key": key])
XCTAssertEqual(params.key, binaryKey as Data)
}

// RSE1d
func test__002__Crypto__getDefaultParams__calculates_a_keyLength_from_the_key__its_size_in_bits_() {
func x_test__002__Crypto__getDefaultParams__calculates_a_keyLength_from_the_key__its_size_in_bits_() {
var params = ARTCrypto.getDefaultParams(["key": binaryKey])
XCTAssertEqual(params.keyLength, 128)

Expand All @@ -68,7 +68,7 @@ class CryptoTests: XCTestCase {
}

// RSE1e
func test__003__Crypto__getDefaultParams__should_check_that_keyLength_is_valid_for_algorithm() {
func x_test__003__Crypto__getDefaultParams__should_check_that_keyLength_is_valid_for_algorithm() {
expect { ARTCrypto.getDefaultParams([
"key": binaryKey.subdata(in: 0 ..< 10),
]) }.to(raiseException())
Expand All @@ -77,7 +77,7 @@ class CryptoTests: XCTestCase {
// RSE2

// RSE2a, RSE2b
func test__007__Crypto__generateRandomKey__takes_a_single_length_argument_and_returns_a_binary() {
func x_test__007__Crypto__generateRandomKey__takes_a_single_length_argument_and_returns_a_binary() {
var key: NSData = ARTCrypto.generateRandomKey(128) as NSData
XCTAssertEqual(key.length, 128 / 8)

Expand All @@ -86,20 +86,20 @@ class CryptoTests: XCTestCase {
}

// RSE2a, RSE2b
func test__008__Crypto__generateRandomKey__takes_no_arguments_and_returns_the_default_algorithm_s_default_length() {
func x_test__008__Crypto__generateRandomKey__takes_no_arguments_and_returns_the_default_algorithm_s_default_length() {
let key: NSData = ARTCrypto.generateRandomKey() as NSData
XCTAssertEqual(key.length, 256 / 8)
}

func test__009__Crypto__generateHashSHA256__takes_data_and_returns_a_SHA256_digest() {
func x_test__009__Crypto__generateHashSHA256__takes_data_and_returns_a_SHA256_digest() {
let string = "The quick brown fox jumps over the lazy dog"
let expectedHash = "D7A8FBB307D7809469CA9ABCB0082E4F8D5651E46D3CDB762D02D0BF37C9E592" // hex
let stringData = string.data(using: .utf8)!
let result = ARTCrypto.generateHashSHA256(stringData)
XCTAssertEqual(result.hexString, expectedHash)
}

func test__010__Crypto__encrypt__should_generate_a_new_IV_every_time_it_s_called__and_should_be_the_first_block_encrypted() {
func x_test__010__Crypto__encrypt__should_generate_a_new_IV_every_time_it_s_called__and_should_be_the_first_block_encrypted() {
let params = ARTCipherParams(algorithm: "aes", key: key as ARTCipherKeyCompatible)
let logger = InternalLog(core: MockInternalLogCore())
let cipher = ARTCrypto.cipher(with: params, logger: logger)
Expand Down Expand Up @@ -248,31 +248,31 @@ class CryptoTests: XCTestCase {
try reusableTestsTestFixture(("crypto-data-128", "cipher+aes-128-cbc", 128), testCase: testCase)
}

func test__011__Crypto__with_fixtures_from_crypto_data_128_json__should_encrypt_messages_as_expected_in_the_fixtures() throws {
func x_test__011__Crypto__with_fixtures_from_crypto_data_128_json__should_encrypt_messages_as_expected_in_the_fixtures() throws {
try reusableTestsWrapper__Crypto__with_fixtures_from_crypto_data_128_json__reusableTestsTestFixture(testCase: .should_encrypt_messages_as_expected_in_the_fixtures)
}

func test__012__Crypto__with_fixtures_from_crypto_data_128_json__should_decrypt_messages_as_expected_in_the_fixtures() throws {
func x_test__012__Crypto__with_fixtures_from_crypto_data_128_json__should_decrypt_messages_as_expected_in_the_fixtures() throws {
try reusableTestsWrapper__Crypto__with_fixtures_from_crypto_data_128_json__reusableTestsTestFixture(testCase: .should_decrypt_messages_as_expected_in_the_fixtures)
}

func reusableTestsWrapper__Crypto__with_fixtures_from_crypto_data_256_json__reusableTestsTestFixture(testCase: TestCase_ReusableTestsTestFixture) throws {
try reusableTestsTestFixture(("crypto-data-256", "cipher+aes-256-cbc", 256), testCase: testCase)
}

func test__013__Crypto__with_fixtures_from_crypto_data_256_json__should_encrypt_messages_as_expected_in_the_fixtures() throws {
func x_test__013__Crypto__with_fixtures_from_crypto_data_256_json__should_encrypt_messages_as_expected_in_the_fixtures() throws {
try reusableTestsWrapper__Crypto__with_fixtures_from_crypto_data_256_json__reusableTestsTestFixture(testCase: .should_encrypt_messages_as_expected_in_the_fixtures)
}

func test__014__Crypto__with_fixtures_from_crypto_data_256_json__should_decrypt_messages_as_expected_in_the_fixtures() throws {
func x_test__014__Crypto__with_fixtures_from_crypto_data_256_json__should_decrypt_messages_as_expected_in_the_fixtures() throws {
try reusableTestsWrapper__Crypto__with_fixtures_from_crypto_data_256_json__reusableTestsTestFixture(testCase: .should_decrypt_messages_as_expected_in_the_fixtures)
}

func test__015__Crypto__with_fixtures_from_crypto_data_128_json__manual_decrypt_messages_as_expected_in_the_fixtures() throws {
func x_test__015__Crypto__with_fixtures_from_crypto_data_128_json__manual_decrypt_messages_as_expected_in_the_fixtures() throws {
try reusableTestsTestManualDecryption(fileName: "crypto-data-128", expectedEncryptedEncoding: "cipher+aes-128-cbc", keyLength: 128)
}

func test__016__Crypto__with_fixtures_from_crypto_data_256_json__manual_decrypt_messages_as_expected_in_the_fixtures() throws {
func x_test__016__Crypto__with_fixtures_from_crypto_data_256_json__manual_decrypt_messages_as_expected_in_the_fixtures() throws {
try reusableTestsTestManualDecryption(fileName: "crypto-data-256", expectedEncryptedEncoding: "cipher+aes-256-cbc", keyLength: 256)
}
}
8 changes: 4 additions & 4 deletions Test/Tests/DefaultErrorCheckerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Ably.Private
final class DefaultErrorCheckerTests: XCTestCase {
private let checker = DefaultErrorChecker()

func test_isTokenError_statusCode401AndCodeBetween40140And40150() {
func x_test_isTokenError_statusCode401AndCodeBetween40140And40150() {
let errorInfo = ARTErrorInfo.create(
withCode: 40145, // arbitrarily chosen in range 40140 ..< 40150
status: 401,
Expand All @@ -14,7 +14,7 @@ final class DefaultErrorCheckerTests: XCTestCase {
XCTAssertTrue(checker.isTokenError(errorInfo))
}

func test_isTokenError_statusCodeNot401() {
func x_test_isTokenError_statusCodeNot401() {
let errorInfo = ARTErrorInfo.create(
withCode: 40145, // arbitrarily chosen within range 40140 ..< 40150
status: 200, // arbitrarily chosen, != 401
Expand All @@ -24,7 +24,7 @@ final class DefaultErrorCheckerTests: XCTestCase {
XCTAssertFalse(checker.isTokenError(errorInfo))
}

func test_isTokenError_statusCode401ButCodeLessThan40140() {
func x_test_isTokenError_statusCode401ButCodeLessThan40140() {
let errorInfo = ARTErrorInfo.create(
withCode: 40139, // arbitrarily chosen < 40140
status: 401,
Expand All @@ -34,7 +34,7 @@ final class DefaultErrorCheckerTests: XCTestCase {
XCTAssertFalse(checker.isTokenError(errorInfo))
}

func test_isTokenError_statusCode401ButCodeGreaterThanOrEqualTo40150() {
func x_test_isTokenError_statusCode401ButCodeGreaterThanOrEqualTo40150() {
let errorInfo = ARTErrorInfo.create(
withCode: 40150, // arbitrarily chosen >= 40150
status: 401,
Expand Down
10 changes: 5 additions & 5 deletions Test/Tests/DefaultInternalLogCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import XCTest
import Ably.Private

class DefaultInternalLogCoreTests: XCTestCase {
func test_initWithClientOptions_whenClientOptionsLogLevelIsNotNone() throws {
func x_test_initWithClientOptions_whenClientOptionsLogLevelIsNotNone() throws {
// Given: client options whose logLevel is .verbose (arbitrarily chosen, not .none), and whose logHandler has logLevel .info (arbitrarily chosen, not equal to .verbose)
let clientOptions = ARTClientOptions()
clientOptions.logLevel = .verbose
Expand All @@ -18,7 +18,7 @@ class DefaultInternalLogCoreTests: XCTestCase {
XCTAssertEqual(clientOptions.logHandler.logLevel, .verbose)
}

func test_initWithClientOptions_whenClientOptionsLogLevelIsNone() throws {
func x_test_initWithClientOptions_whenClientOptionsLogLevelIsNone() throws {
// Given: client options whose logLevel is .none, and whose logHandler has logLevel .info (arbitrarily chosen, not equal to .none)

let clientOptions = ARTClientOptions()
Expand All @@ -35,7 +35,7 @@ class DefaultInternalLogCoreTests: XCTestCase {
XCTAssertEqual(clientOptions.logHandler.logLevel, .info)
}

func test_logMessage() {
func x_test_logMessage() {
let mock = MockVersion2Log()
let core = DefaultInternalLogCore(logger: mock)

Expand All @@ -52,15 +52,15 @@ class DefaultInternalLogCoreTests: XCTestCase {
}
}

func test_logLevel() {
func x_test_logLevel() {
let mock = MockVersion2Log()
mock.logLevel = .info
let core = DefaultInternalLogCore(logger: mock)

XCTAssertEqual(core.logLevel, .info)
}

func test_setLogLevel() {
func x_test_setLogLevel() {
let mock = MockVersion2Log()
mock.logLevel = .info
let core = DefaultInternalLogCore(logger: mock)
Expand Down
4 changes: 2 additions & 2 deletions Test/Tests/DefaultJitterCoefficientGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import XCTest
import Ably.Private

class DefaultJitterCoefficientGeneratorTests: XCTestCase {
func test_generatesValuesInExpectedRange() {
func x_test_generatesValuesInExpectedRange() {
let generator = DefaultJitterCoefficientGenerator()
let generatedCoefficients = (1...100).map { _ in generator.generateJitterCoefficient() }

XCTAssertTrue(generatedCoefficients.allSatisfy { (0.8...1.0).contains($0) })
}

func test_generatesAVarietyOfValues() {
func x_test_generatesAVarietyOfValues() {
let generator = DefaultJitterCoefficientGenerator()
let generatedCoefficients = (1...100).map { _ in generator.generateJitterCoefficient() }

Expand Down
Loading

0 comments on commit 861920f

Please sign in to comment.