/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #import #import "FBRuntimeUtils.h" #import "XCTestPrivateSymbols.h" @protocol FBMagicProtocol @end const NSString *FBRuntimeUtilsTestsConstString = @"FBRuntimeUtilsTestsConstString"; @interface FBRuntimeUtilsTests : XCTestCase @end @implementation FBRuntimeUtilsTests - (void)testClassesThatConformsToProtocol { XCTAssertEqualObjects(@[self.class], FBClassesThatConformsToProtocol(@protocol(FBMagicProtocol))); } - (void)testRetrievingFrameworkSymbols { NSString *binaryPath = [NSBundle bundleForClass:self.class].executablePath; NSString *symbolPointer = *(NSString*__autoreleasing*)FBRetrieveSymbolFromBinary(binaryPath.UTF8String, "FBRuntimeUtilsTestsConstString"); XCTAssertNotNil(symbolPointer); XCTAssertEqualObjects(symbolPointer, FBRuntimeUtilsTestsConstString); } - (void)testXCTestSymbols { XCTAssertTrue(XCDebugLogger != NULL); XCTAssertTrue(XCSetDebugLogger != NULL); XCTAssertNotNil(FB_XCAXAIsVisibleAttribute); XCTAssertNotNil(FB_XCAXAIsElementAttribute); } @end