diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..ce4be89 --- /dev/null +++ b/.clang-format @@ -0,0 +1,61 @@ +# For options, see http://clang.llvm.org/docs/ClangFormatStyleOptions.html + +# A style complying with Google’s C++ style guide +BasedOnStyle: Google + +# If true, horizontally aligns arguments after an open bracket. +# This applies to round brackets (parentheses), angle brackets and square brackets. +AlignAfterOpenBracket: true + +# If true, horizontally align operands of binary and ternary expressions. +AlignOperands: false + +# Allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false. +AllowAllParametersOfDeclarationOnNextLine: true + +# If true, always break after the template<...> of a template declaration. +AlwaysBreakTemplateDeclarations: true + +# If false, a function call’s arguments will either be all on the same line or will have one line each. +BinPackArguments: false + +# If false, a function call’s or function definition’s parameters will either all be on the same line or will have one line each. +BinPackParameters: false + +# If true, ternary operators will be placed after line breaks. +BreakBeforeTernaryOperators: true + +# Column limit for Obj-C at Google is 100 +ColumnLimit: 100 + +# Indent width for line continuations. +ContinuationIndentWidth: 4 + +# If true, analyze the formatted file for the most common alignment of & and *. PointerAlignment is then used only as fallback. +DerivePointerAlignment: false + +# The number of characters to use for indentation of ObjC blocks. +ObjCBlockIndentWidth: 2 + +# Add a space after @property in Objective-C. +# i.e. use \@property (readonly) instead of \@property(readonly). +ObjCSpaceAfterProperty: false + +# Add a space in front of an Objective-C protocol list +# i.e. use Foo instead of Foo. +ObjCSpaceBeforeProtocolList: true + +# Pointer and reference alignment style. +# ie. Right means * and & align to the variable, not the type. +# (PointerBindsToType looks like it's been deprecated and replaced by PointerAlignment) +PointerBindsToType: false +PointerAlignment: Right + +# If true, spaces are inserted inside container literals (e.g. ObjC array and dict literals). +SpacesInContainerLiterals: true + +# The number of columns used for tab stops. +TabWidth: 2 + +# The way to use tab characters in the resulting file. +UseTab: Never \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..8dc7e75 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,41 @@ +--- +name: "🐛 Bug Report" +about: Report a reproducible bug or regression. +title: 'Bug: ' +labels: 'bug' + +--- + + + +Application version: + +## Steps To Reproduce + +1. +2. + + + +Link to code example: + + + +## The current behavior + + +## The expected behavior \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b3fb3c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,11 @@ +--- +name: 🛠 Feature request +about: If you have a feature request for the capture-kit, file it here. +labels: 'type: enhancement' +--- + +**Feature description** +Clearly and concisely describe the feature. + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/bug_template.yml b/.github/PULL_REQUEST_TEMPLATE/bug_template.yml new file mode 100644 index 0000000..7d6a149 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/bug_template.yml @@ -0,0 +1,9 @@ +## Bug description +Clearly and concisely describe the problem. + +## Solution description +Describe your code changes in detail for reviewers. Explain the technical solution you have provided and how it fixes the issue case. + +## Covered unit test cases +- [x] yes +- [x] no \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/feature_template.yml b/.github/PULL_REQUEST_TEMPLATE/feature_template.yml new file mode 100644 index 0000000..ab3978b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/feature_template.yml @@ -0,0 +1,12 @@ +## Feature description +Clearly and concisely describe the feature. + +## Solution description +Describe your code changes in detail for reviewers. + +## Areas affected and ensured +List out the areas affected by your code changes. + +## Covered unit test cases +- [x] yes +- [x] no \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..90aa7f2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: "capture-kit" + +on: + push: + branches: + - main + - dev + pull_request: + - ".github/workflows/**" + - "CaptureKit/**" + - "CaptureKitTests/**" + +concurrency: + group: ci + cancel-in-progress: true + +jobs: + Latest: + name: Test Latest (macOS) + runs-on: macOS-12 + env: + DEVELOPER_DIR: "/Applications/Xcode_14.1.app/Contents/Developer" + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + include: + - destination: "platform=macOS" + name: "macOS" + scheme: "CaptureKit" + sdk: macosx + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Dependencies + run: brew bundle + - name: Generate project + run: xcodegen generate + - name: ${{ matrix.name }} + run: xcodebuild test -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "./${{ matrix.sdk }}.xcresult" + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3.1.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + xcode: true + xcode_archive_path: "./${{ matrix.sdk }}.xcresult" \ No newline at end of file diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml new file mode 100644 index 0000000..1a0ab52 --- /dev/null +++ b/.github/workflows/danger.yml @@ -0,0 +1,29 @@ +name: Danger + +on: + pull_request: + types: [synchronize, opened, reopened, labeled, unlabeled, edited] + +env: + LC_CTYPE: en_US.UTF-8 + LANG: en_US.UTF-8 + +jobs: + run-danger: + runs-on: ubuntu-latest + steps: + - name: ruby setup + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup gems + run: | + gem install bundler + bundle install --clean --path vendor/bundle + - name: danger + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} + run: bundle exec danger --verbose \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7801c93..d950079 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ fastlane/test_output # https://github.com/johnno1962/injectionforxcode iOSInjectionProject/ +*.xcodeproj \ No newline at end of file diff --git a/.oclint b/.oclint new file mode 100644 index 0000000..5fc148b --- /dev/null +++ b/.oclint @@ -0,0 +1,7 @@ +disable-rules: + - AssignIvarOutsideAccessors + - LongVariableName +rule-configurations: + - key: LONG_LINE + value: 200 +enable-clang-static-analyzer: true \ No newline at end of file diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..13a4bba --- /dev/null +++ b/Brewfile @@ -0,0 +1,2 @@ +brew "clang-format" +brew "xcodegen" \ No newline at end of file diff --git a/Brewfile.lock.json b/Brewfile.lock.json new file mode 100644 index 0000000..c99707f --- /dev/null +++ b/Brewfile.lock.json @@ -0,0 +1,101 @@ +{ + "entries": { + "brew": { + "clang-format": { + "version": "17.0.2", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:1efd2fee1635d34114bd9d6daa1390b66a8df8621feec3c6650d6ef9ba4ade8d", + "sha256": "1efd2fee1635d34114bd9d6daa1390b66a8df8621feec3c6650d6ef9ba4ade8d" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:dd037c2099365c36fe7f98b7a88fd9b38e4e98f176c272ddf647999b52961e68", + "sha256": "dd037c2099365c36fe7f98b7a88fd9b38e4e98f176c272ddf647999b52961e68" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:2d6db6df5d9dc8dfe2261d92e24979a7ab95c03ab630696ce000a343f375e262", + "sha256": "2d6db6df5d9dc8dfe2261d92e24979a7ab95c03ab630696ce000a343f375e262" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:fe42f4d3a1ae819f7da81d811b06cd3aca135d4169f5f7f0e6643e1ba82ad760", + "sha256": "fe42f4d3a1ae819f7da81d811b06cd3aca135d4169f5f7f0e6643e1ba82ad760" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:dbca4323c6321af28c7c0e15ffc1c9d8d62fb0b8e74709c500d1724d23a292ba", + "sha256": "dbca4323c6321af28c7c0e15ffc1c9d8d62fb0b8e74709c500d1724d23a292ba" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:e00953e72bf88cd9ec6067d0d6939ec01fe92b555ea00561681ea71ff4556d03", + "sha256": "e00953e72bf88cd9ec6067d0d6939ec01fe92b555ea00561681ea71ff4556d03" + }, + "x86_64_linux": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/clang-format/blobs/sha256:64a41e19b976c1725c0f47d7933c5ff34c153c60b68354a503410e41efbfc5e8", + "sha256": "64a41e19b976c1725c0f47d7933c5ff34c153c60b68354a503410e41efbfc5e8" + } + } + } + }, + "xcodegen": { + "version": "2.37.0", + "bottle": { + "rebuild": 0, + "root_url": "https://ghcr.io/v2/homebrew/core", + "files": { + "arm64_sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/xcodegen/blobs/sha256:01a6e074defcf2b17bb25bdc28daf96bbfd9aaea65f40c4f31b34178e04a2477", + "sha256": "01a6e074defcf2b17bb25bdc28daf96bbfd9aaea65f40c4f31b34178e04a2477" + }, + "arm64_ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/xcodegen/blobs/sha256:9d147d0bbde8f76fe1c88da308c1f99e866d1702458e82b685a164505de10093", + "sha256": "9d147d0bbde8f76fe1c88da308c1f99e866d1702458e82b685a164505de10093" + }, + "arm64_monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/xcodegen/blobs/sha256:9058c7b14f8ea6e8457c808db3329eb0b2f7aa3de00d147e931501dcc2e26874", + "sha256": "9058c7b14f8ea6e8457c808db3329eb0b2f7aa3de00d147e931501dcc2e26874" + }, + "sonoma": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/xcodegen/blobs/sha256:162c4534eb6bfcf41d8b0447830001fd08d9d38aa4151aa62eee66858b4ddc55", + "sha256": "162c4534eb6bfcf41d8b0447830001fd08d9d38aa4151aa62eee66858b4ddc55" + }, + "ventura": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/xcodegen/blobs/sha256:caddccdd2b82aef7ae9221d1249b0af14bf5c4befe8ceb5445d55a9150649ed6", + "sha256": "caddccdd2b82aef7ae9221d1249b0af14bf5c4befe8ceb5445d55a9150649ed6" + }, + "monterey": { + "cellar": ":any_skip_relocation", + "url": "https://ghcr.io/v2/homebrew/core/xcodegen/blobs/sha256:54fefbac5d69356b64354c1e7b281feeee2ae27ee79cf34505a0e23a3d2196a9", + "sha256": "54fefbac5d69356b64354c1e7b281feeee2ae27ee79cf34505a0e23a3d2196a9" + } + } + } + } + } + }, + "system": { + "macos": { + "ventura": { + "HOMEBREW_VERSION": "4.1.15", + "HOMEBREW_PREFIX": "/usr/local", + "Homebrew/homebrew-core": "api", + "CLT": "", + "Xcode": "14.1", + "macOS": "13.4" + } + } + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0d196c4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +#Change Log +All notable changes to this project will be documented in this file. + +#### 1.x Releases +- `1.0.x` Releases - [1.0.0](#100) + +## [1.0.0](https://github.com/space-code/capture-kit/releases/tag/1.0.0) +Released on 2023-10-19. + +#### Added +- Initial release of CaptureKit. + - Added by [Nikita Vasilev](https://github.com/nik3212). \ No newline at end of file diff --git a/CaptureKit.podspec b/CaptureKit.podspec new file mode 100644 index 0000000..a8098c8 --- /dev/null +++ b/CaptureKit.podspec @@ -0,0 +1,14 @@ +Pod::Spec.new do |s| + s.name = 'CaptureKit' + s.version = '1.0.0' + s.license = 'MIT' + s.summary = 'A screen capture framework' + s.homepage = 'https://github.com/space-code/capture-kit' + s.authors = { 'Nikita Vasilev' => 'nv3212@gmail.com' } + s.source = { :git => 'https://github.com/space-code/capture-kit.git', :tag => s.version } + s.documentation_url = 'https://github.com/space-code/capture-kit' + + s.osx.deployment_target = '10.12' + + s.source_files = 'CaptureKit/CaptureKit.h' +end \ No newline at end of file diff --git a/CaptureKit/CaptureKit.h b/CaptureKit/CaptureKit.h new file mode 100644 index 0000000..72784a2 --- /dev/null +++ b/CaptureKit/CaptureKit.h @@ -0,0 +1,22 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import + +//! Project version number for CaptureKit. +FOUNDATION_EXPORT double CaptureKitVersionNumber; + +//! Project version string for CaptureKit. +FOUNDATION_EXPORT const unsigned char CaptureKitVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like +// #import + +#import +#import +#import +#import +#import +#import diff --git a/CaptureKit/Classes/Core/Models/NVCaptureConfiguration.h b/CaptureKit/Classes/Core/Models/NVCaptureConfiguration.h new file mode 100644 index 0000000..92c5a58 --- /dev/null +++ b/CaptureKit/Classes/Core/Models/NVCaptureConfiguration.h @@ -0,0 +1,42 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import "NVCaptureQuality.h" + +NS_ASSUME_NONNULL_BEGIN + +/// NVCaptureConfiguration is a class that represents a configuration for capturing video. +@interface NVCaptureConfiguration : NSObject +/// This initializer is unavailable and should not be used. +- (instancetype)init NS_UNAVAILABLE; + +/// Creates an `NVCaptureConfiguration` object with specified settings. +/// +/// - Parameters: +/// - fps: The frames per second (FPS) for video capture. +/// - capturesCursor: A Boolean indicating whether the cursor should be captured in the video. +/// - capturesMouseClicks: A Boolean indicating whether mouse clicks should be captured. +/// - captureQuality: The quality setting for video capture. +- (nullable instancetype)initWithFPS:(NSUInteger)fps + capturesCursor:(BOOL)capturesCursor + capturesMouseClicks:(BOOL)capturesMouseClicks + captureQuality:(NVCaptureQuality)captureQuality; + +/// The frames per second (FPS) for video capture. +@property(nonatomic, readonly, assign) NSUInteger fps; +/// A Boolean indicating whether the cursor should be captured in the video. +@property(nonatomic, readonly, assign) BOOL capturesCursor; +/// A Boolean indicating whether mouse clicks should be captured. +@property(nonatomic, readonly, assign) BOOL capturesMouseClicks; +/// The quality setting for video capture. +@property(nonatomic, readonly, assign) NVCaptureQuality captureQuality; + +/// An NVCaptureConfiguration object with default settings. ++ (NVCaptureConfiguration *)default; + +@end + +NS_ASSUME_NONNULL_END diff --git a/CaptureKit/Classes/Core/Models/NVCaptureConfiguration.m b/CaptureKit/Classes/Core/Models/NVCaptureConfiguration.m new file mode 100644 index 0000000..4fabee7 --- /dev/null +++ b/CaptureKit/Classes/Core/Models/NVCaptureConfiguration.m @@ -0,0 +1,48 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import "NVCaptureConfiguration.h" +#import + +@implementation NVCaptureConfiguration + +#pragma mark - Initialization + +- (instancetype)init { + return nil; +} + +- (nullable instancetype)initWithFPS:(NSUInteger)fps + capturesCursor:(BOOL)capturesCursor + capturesMouseClicks:(BOOL)capturesMouseClicks + captureQuality:(NVCaptureQuality)captureQuality { + self = [super init]; + + if (self) { + _fps = fps; + _capturesCursor = capturesCursor; + _capturesMouseClicks = capturesMouseClicks; + _captureQuality = captureQuality; + } + + return self; +} + +#pragma mark - Class Methods + ++ (NVCaptureConfiguration *)default { + return [[NVCaptureConfiguration alloc] initWithFPS:60 + capturesCursor:YES + capturesMouseClicks:NO + captureQuality:High]; +} + +#pragma mark - NSCopying + +- (id)copyWithZone:(NSZone *)zone { + return self; +} + +@end diff --git a/CaptureKit/Classes/Core/Models/NVCaptureQuality.h b/CaptureKit/Classes/Core/Models/NVCaptureQuality.h new file mode 100644 index 0000000..2dc2393 --- /dev/null +++ b/CaptureKit/Classes/Core/Models/NVCaptureQuality.h @@ -0,0 +1,15 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#ifndef NVCaptureQuality_h +#define NVCaptureQuality_h + +typedef NS_ENUM(NSUInteger, NVCaptureQuality) { + High, + Medium, + Low, +}; + +#endif /* NVCaptureQuality_h */ diff --git a/CaptureKit/Classes/Core/Provider/DisplayBoundsProvider/NVDisplayBoundsProvider.h b/CaptureKit/Classes/Core/Provider/DisplayBoundsProvider/NVDisplayBoundsProvider.h new file mode 100644 index 0000000..35517ca --- /dev/null +++ b/CaptureKit/Classes/Core/Provider/DisplayBoundsProvider/NVDisplayBoundsProvider.h @@ -0,0 +1,25 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NVDisplayBoundsProvider : NSObject + +/// Returns a shared instance of NVDisplayBoundsProvider ++ (nullable instancetype)sharedInstance; + +/// Retrieves the bounds (CGRect) of the display with the specified display ID. +/// +/// - Parameter displayID: The CGDirectDisplayID of the display whose bounds you want to retrieve. +/// +/// - Returns: The bounds (CGRect) of the display identified by the provided CGDirectDisplayID. +- (CGRect)boundsForDisplayWithID:(CGDirectDisplayID)displayID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/CaptureKit/Classes/Core/Provider/DisplayBoundsProvider/NVDisplayBoundsProvider.m b/CaptureKit/Classes/Core/Provider/DisplayBoundsProvider/NVDisplayBoundsProvider.m new file mode 100644 index 0000000..74ba061 --- /dev/null +++ b/CaptureKit/Classes/Core/Provider/DisplayBoundsProvider/NVDisplayBoundsProvider.m @@ -0,0 +1,27 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import "NVDisplayBoundsProvider.h" + +@implementation NVDisplayBoundsProvider + ++ (nullable instancetype)sharedInstance { + static dispatch_once_t onceToken = 0; + + __strong static id _sharedObject = nil; + + dispatch_once(&onceToken, ^{ + _sharedObject = [[self alloc] init]; + }); + + return _sharedObject; +} + +- (CGRect)boundsForDisplayWithID:(CGDirectDisplayID)displayID { + CGRect rect = CGDisplayBounds(displayID); + return rect; +} + +@end diff --git a/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/NVMediaDeviceProvider.h b/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/NVMediaDeviceProvider.h new file mode 100644 index 0000000..8310332 --- /dev/null +++ b/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/NVMediaDeviceProvider.h @@ -0,0 +1,25 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import + +#import "NVIMediaProvider.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface NVMediaDeviceProvider : NSObject + +/// Retrieves an array of media devices of the specified media type. +/// +/// @param type The media type for which you want to retrieve devices. Use constants like +/// `AVMediaTypeAudio` or `AVMediaTypeVideo` to specify the type. +/// @return An array of AVCaptureDevice instances representing the available media devices of the +/// specified type. +- (NSArray *)devicesWithMediaType:(AVMediaType)type; + +@end + +NS_ASSUME_NONNULL_END diff --git a/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/NVMediaDeviceProvider.m b/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/NVMediaDeviceProvider.m new file mode 100644 index 0000000..bae8a6a --- /dev/null +++ b/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/NVMediaDeviceProvider.m @@ -0,0 +1,20 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import "NVMediaDeviceProvider.h" + +#import "NVIMediaProvider.h" + +@interface NVMediaDeviceProvider () + +@end + +@implementation NVMediaDeviceProvider + +- (NSArray *)devicesWithMediaType:(AVMediaType)type { + return [AVCaptureDevice devicesWithMediaType:type]; +} + +@end diff --git a/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/Protocols/NVIMediaProvider.h b/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/Protocols/NVIMediaProvider.h new file mode 100644 index 0000000..2d6e0d4 --- /dev/null +++ b/CaptureKit/Classes/Core/Provider/MediaDeviceProvider/Protocols/NVIMediaProvider.h @@ -0,0 +1,31 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#ifndef NVIMediaProvider_h +#define NVIMediaProvider_h + +#import + +/// The `NVIMediaProvider` protocol defines methods for retrieving media-related information and +/// devices. +/// +/// The conforming classes should implement the methods defined in this protocol to provide access +/// to media devices and related functionalities. +/// +/// @note This protocol assumes that the conforming classes will provide non-null values for the +/// return type and that the `type` parameter should be valid. +@protocol NVIMediaProvider + +/// Retrieves an array of media devices of the specified media type. +/// +/// @param type The media type for which you want to retrieve devices. Use constants like +/// `AVMediaTypeAudio` or `AVMediaTypeVideo` to specify the type. +/// @return An array of AVCaptureDevice instances representing the available media devices of the +/// specified type. +- (NSArray *)devicesWithMediaType:(AVMediaType)type; + +@end + +#endif /* NVIMediaProvider_h */ diff --git a/CaptureKit/Classes/Core/Services/AudioService/NVAudioService.h b/CaptureKit/Classes/Core/Services/AudioService/NVAudioService.h new file mode 100644 index 0000000..fb9e435 --- /dev/null +++ b/CaptureKit/Classes/Core/Services/AudioService/NVAudioService.h @@ -0,0 +1,41 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import + +#import "NVIMediaProvider.h" + +NS_ASSUME_NONNULL_BEGIN + +/// NVAudioService is a class responsible for managing audio devices and their connections. +@interface NVAudioService : NSObject + +/// Initializes an instance of NVAudioService with a media device provider. +/// +/// @param mediaDeviceProvider An object conforming to the NVIMediaProvider protocol that provides +/// media-related functionality. +/// @return An initialized NVAudioService instance. +- (id)initWithMediaDeviceProvider:(id)mediaDeviceProvider; + +/// Retrieves the list of connected audio devices. +/// +/// @return An array of connected devices. +- (NSArray *)audioDevices; + +/// Retrieves the unique identifiers of audio devices. +/// +/// @return An array of unique identifiers (NSString) of audio devices. +- (NSArray *)audioDevicesIDs; + +/// Checks if an audio device with the specified unique identifier is currently connected. +/// +/// @param uniqueID The unique identifier (NSString) of the audio device to check. +/// @return YES if the audio device is connected, NO otherwise. +- (BOOL)isAudioDeviceConnected:(NSString *)uniqueID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/CaptureKit/Classes/Core/Services/AudioService/NVAudioService.m b/CaptureKit/Classes/Core/Services/AudioService/NVAudioService.m new file mode 100644 index 0000000..a731ab7 --- /dev/null +++ b/CaptureKit/Classes/Core/Services/AudioService/NVAudioService.m @@ -0,0 +1,62 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import "NVAudioService.h" + +@interface NVAudioService () + +@property(nonatomic, strong) id mediaDeviceProvider; + +@end + +@implementation NVAudioService + +#pragma mark - Initialization + +- (id)initWithMediaDeviceProvider:(id)mediaDeviceProvider { + if (self = [super init]) { + self.mediaDeviceProvider = mediaDeviceProvider; + } + return self; +} + +#pragma mark - Public + +- (NSArray *)audioDevicesIDs { + NSArray *audioDevices = [self audioDevices]; + return [self audioDevicesIDs:audioDevices]; +} + +- (BOOL)isAudioDeviceConnected:(NSString *)uniqueID { + NSArray *audioDevices = [self audioDevices]; + NSArray *devicesIDs = [self audioDevicesIDs:audioDevices]; + + return [devicesIDs containsObject:uniqueID]; +} + +- (NSArray *)audioDevices { + NSArray *audioDevices = + [self.mediaDeviceProvider devicesWithMediaType:AVMediaTypeAudio]; + return audioDevices; +} + +#pragma mark - Private + +- (NSArray *)audioDevicesIDs:(NSArray *)devices { + if (devices == nil || devices.count == 0) { + return nil; + } + + NSInteger numberOfDevices = devices.count; + NSMutableArray *devicesIDs = [[NSMutableArray alloc] init]; + + for (int i = 0; i < numberOfDevices; ++i) { + devicesIDs[i] = devices[i].uniqueID; + } + + return devicesIDs; +} + +@end diff --git a/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureService.h b/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureService.h new file mode 100644 index 0000000..9dc2619 --- /dev/null +++ b/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureService.h @@ -0,0 +1,63 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import + +#import "NVCaptureConfiguration.h" +#import "NVCaptureServiceDelegate.h" + +NS_ASSUME_NONNULL_BEGIN + +/// A class responsible for managing video capture and recording using AVCaptureSession. +@interface NVCaptureService : NSObject + +/// The delegate will receive notifications about recording events and errors. +@property(nonatomic, weak) id delegate; + +/// A read-only property that provides access to the AVCaptureSession used for video capture. +@property(nonatomic, strong, readonly) AVCaptureSession *captureSession; +/// A read-only property that provides access to the AVCaptureMovieFileOutput used for recording +/// video. +@property(nonatomic, strong, readonly) AVCaptureMovieFileOutput *fileOutput; + +/// Starts video recording with specified configuration. +/// +/// - Parameters: +/// - uniqueID: The unique identifier of the audio device to be used for recording. +/// - rect: The CGRect specifying the capture area. +/// - displayID: The CGDirectDisplayID of the display to be captured. +/// - outputFileURL: The NSURL specifying the output file URL where the recording will be saved. +- (void)startRecordingWithAudioDeviceID:(NSString *)uniqueID + rect:(CGRect)rect + directDisplayID:(CGDirectDisplayID)displayID + outputFileURL:(NSURL *)outputFileURL; + +/// Starts video recording with a configuration object and specified parameters. +/// +/// - Parameters: +/// - configuration: An NVCaptureConfiguration object that specifies capture settings. +/// - uniqueID: The unique identifier of the audio device to be used for recording. +/// - rect: The CGRect specifying the capture area. +/// - displayID: The CGDirectDisplayID of the display to be captured. +/// - outputFileURL: The NSURL specifying the output file URL where the recording will be saved. +- (void)startRecordingWithConfiguration:(NVCaptureConfiguration *)configuration + deviceID:(NSString *)uniqueID + rect:(CGRect)rect + directDisplayID:(CGDirectDisplayID)displayID + outputFileURL:(NSURL *)outputFileURL; + +/// Stops the current video recording session. +- (void)stop; + +/// Pauses the current video recording session. +- (void)pause; + +/// Resumes a paused video recording session. +- (void)resume; + +@end + +NS_ASSUME_NONNULL_END diff --git a/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureService.m b/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureService.m new file mode 100644 index 0000000..087cba4 --- /dev/null +++ b/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureService.m @@ -0,0 +1,192 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#import "NVCaptureService.h" +#import "NVDisplayBoundsProvider.h" + +@interface NVCaptureService () + +@property(nonatomic, strong) NVCaptureConfiguration *configuration; + +@end + +@implementation NVCaptureService + +#pragma mark - Initialization + +- (instancetype)init { + if (self = [super init]) { + _configuration = [NVCaptureConfiguration default]; + } + return self; +} + +#pragma mark - Public + +- (void)startRecordingWithAudioDeviceID:(NSString *)uniqueID + rect:(CGRect)rect + directDisplayID:(CGDirectDisplayID)displayID + outputFileURL:(NSURL *)outputFileURL { + [self startRecordingWithConfiguration:[NVCaptureConfiguration default] + deviceID:uniqueID + rect:rect + directDisplayID:displayID + outputFileURL:outputFileURL]; +} + +- (void)startRecordingWithConfiguration:(NVCaptureConfiguration *)configuration + deviceID:(NSString *)uniqueID + rect:(CGRect)rect + directDisplayID:(CGDirectDisplayID)displayID + outputFileURL:(NSURL *)outputFileURL { + [self setupWithRect:rect directDisplayID:displayID]; + [self setCaptureDeviceWithDeviceID:uniqueID rect:rect]; + [self startCapturingToOutputFileURL:outputFileURL]; +} + +- (void)stop { + if ([_fileOutput isRecording]) { + [_fileOutput stopRecording]; + [_captureSession stopRunning]; + _captureSession = nil; + } +} + +- (void)pause { + if ([_fileOutput isRecording]) { + [_fileOutput pauseRecording]; + } +} + +- (void)resume { + if ([_fileOutput isRecording]) { + [_fileOutput resumeRecording]; + } +} + +#pragma mark - Private + +- (void)setupWithRect:(CGRect)rect directDisplayID:(CGDirectDisplayID)displayID { + _captureSession = [[AVCaptureSession alloc] init]; + + [self setSessionPresetWithQuality:_configuration.captureQuality]; + + CGDirectDisplayID currentID = displayID; + + CGDirectDisplayID id; + CGDisplayCount count; + CGDisplayErr err = CGGetDisplaysWithPoint(rect.origin, 1, &id, &count); + + if (err == kCGErrorSuccess) { + currentID = id; + } + + [self setCaptureScreenInputWithDisplayID:currentID rect:rect]; +} + +- (void)setCaptureScreenInputWithDisplayID:(CGDirectDisplayID)displayID rect:(CGRect)rect { + AVCaptureScreenInput *input = [[AVCaptureScreenInput alloc] initWithDisplayID:displayID]; + + CMTime minimumFrameDuration = CMTimeMake(1, (int32_t)_configuration.fps); + [input setMinFrameDuration:minimumFrameDuration]; + + CGRect displayBounds = + [[NVDisplayBoundsProvider sharedInstance] boundsForDisplayWithID:displayID]; + + input.cropRect = CGRectMake( + rect.origin.x - displayBounds.origin.x, + displayBounds.size.height - displayBounds.origin.y - rect.origin.y - rect.size.height, + rect.size.width, + rect.size.height); + + input.capturesCursor = _configuration.capturesCursor; + input.capturesMouseClicks = _configuration.capturesMouseClicks; + + if (!input) { + _captureSession = nil; + } else if ([_captureSession canAddInput:input]) { + [_captureSession addInput:input]; + } +} + +- (void)setCaptureDeviceWithDeviceID:(NSString *)uniqueID rect:(CGRect)rect { + if (uniqueID != nil) { + AVCaptureDevice *audioDevice = [AVCaptureDevice deviceWithUniqueID:uniqueID]; + AVCaptureDeviceInput *audioInput = [AVCaptureDeviceInput deviceInputWithDevice:audioDevice + error:nil]; + if ([_captureSession canAddInput:audioInput]) { + [_captureSession addInput:audioInput]; + } + } +} + +- (void)setSessionPresetWithQuality:(NVCaptureQuality)quality { + switch (quality) { + case High: + _captureSession.sessionPreset = AVCaptureSessionPresetHigh; + break; + case Medium: + _captureSession.sessionPreset = AVCaptureSessionPresetMedium; + break; + case Low: + _captureSession.sessionPreset = AVCaptureSessionPresetLow; + break; + } +} + +- (void)startCapturingToOutputFileURL:(NSURL *)outputFileURL { + _fileOutput = [[AVCaptureMovieFileOutput alloc] init]; + if ([_captureSession canAddOutput:_fileOutput]) [_captureSession addOutput:_fileOutput]; + + [_captureSession startRunning]; + if ([[NSFileManager defaultManager] fileExistsAtPath:[outputFileURL path]]) { + NSError *err; + + if (![[NSFileManager defaultManager] removeItemAtPath:[outputFileURL path] error:&err]) { + NSLog(@"Error deleting existing movie %@", [err localizedDescription]); + } + } + + [_fileOutput startRecordingToOutputFileURL:outputFileURL recordingDelegate:self]; +} + +#pragma mark - AVCaptureFileOutputRecordingDelegate + +- (void)captureOutput:(AVCaptureFileOutput *)output + didStartRecordingToOutputFileAtURL:(NSURL *)fileURL + fromConnections:(NSArray *)connections { + [_delegate captureService:output + didStartRecordingToOutputFileAtURL:fileURL + fromConnections:connections]; +} + +- (void)captureOutput:(AVCaptureFileOutput *)output + didResumeRecordingToOutputFileAtURL:(NSURL *)fileURL + fromConnections:(NSArray *)connections { + [_delegate captureService:output + didResumeRecordingToOutputFileAtURL:fileURL + fromConnections:connections]; +} + +- (void)captureOutput:(AVCaptureFileOutput *)output + didPauseRecordingToOutputFileAtURL:(NSURL *)fileURL + fromConnections:(NSArray *)connections { + [_delegate captureService:output + didPauseRecordingToOutputFileAtURL:fileURL + fromConnections:connections]; +} + +- (void)captureOutput:(AVCaptureFileOutput *)captureOutput + didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL + fromConnections:(NSArray *)connections + error:(NSError *)error { + [_delegate captureService:captureOutput + didFinishRecordingToOutputFileAtURL:outputFileURL + fromConnections:connections + error:error]; + _fileOutput = nil; +} + +@end diff --git a/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureServiceDelegate.h b/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureServiceDelegate.h new file mode 100644 index 0000000..73c506e --- /dev/null +++ b/CaptureKit/Classes/Core/Services/CaptureService/NVCaptureServiceDelegate.h @@ -0,0 +1,56 @@ +// +// CaptureKit +// Copyright © 2023 Space Code. All rights reserved. +// + +#ifndef NVCaptureServiceDelegate_h +#define NVCaptureServiceDelegate_h + +/// A protocol for delegates of a capture service to receive recording-related events. +@protocol NVCaptureServiceDelegate + +/// Notifies the delegate that recording to a specific output file has finished. +/// +/// - Parameters: +/// - output: The AVCaptureFileOutput instance responsible for the recording. +/// - outputFileURL: The URL where the recording was saved. +/// - connections: An array of AVCaptureConnection objects associated with the recording. +/// - error: An optional error that occurred during recording (or nil if there was no error). +- (void)captureService:(AVCaptureFileOutput *)output + didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL + fromConnections:(NSArray *)connections + error:(NSError *)error; + +/// Notifies the delegate that recording to a specific output file has started. +/// +/// - Parameters: +/// - output: The AVCaptureFileOutput instance responsible for the recording. +/// - fileURL: The URL where the recording was saved. +/// - connections: An array of AVCaptureConnection objects associated with the recording. +- (void)captureService:(AVCaptureFileOutput *)output + didStartRecordingToOutputFileAtURL:(NSURL *)fileURL + fromConnections:(NSArray *)connections; + +/// Notifies the delegate that recording to a specific output file has resumed after being paused. +/// +/// - Parameters: +/// - output: The AVCaptureFileOutput instance responsible for the recording. +/// - fileURL: The URL where the recording was saved. +/// - connections: An array of AVCaptureConnection objects associated with the recording. +- (void)captureService:(AVCaptureFileOutput *)output + didResumeRecordingToOutputFileAtURL:(NSURL *)fileURL + fromConnections:(NSArray *)connections; + +/// Notifies the delegate that recording to a specific output file has been paused. +/// +/// - Parameters: +/// - output: The AVCaptureFileOutput instance responsible for the recording. +/// - fileURL: The URL where the recording was saved. +/// - connections: An array of AVCaptureConnection objects associated with the recording. +- (void)captureService:(AVCaptureFileOutput *)output + didPauseRecordingToOutputFileAtURL:(NSURL *)fileURL + fromConnections:(NSArray *)connections; + +@end + +#endif /* NVCaptureServiceDelegate_h */ diff --git a/CaptureKitTests/NVAudioServiceTests.m b/CaptureKitTests/NVAudioServiceTests.m new file mode 100644 index 0000000..5d59357 --- /dev/null +++ b/CaptureKitTests/NVAudioServiceTests.m @@ -0,0 +1,96 @@ +// +// CaptureKitTests +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import + +#import "NVAudioService.h" + +static NSString *const kDeviceID = @"device-id"; + +@interface NVAudioServiceTests : XCTestCase + +@property(nonatomic, readwrite, strong) id mediaProvider; +@property(nonatomic, readwrite, strong) NVAudioService *audioService; + +@end + +@implementation NVAudioServiceTests + +#pragma mark - XCTestCase + +- (void)setUp { + [super setUp]; + _mediaProvider = OCMProtocolMock(@protocol(NVIMediaProvider)); + _audioService = [[NVAudioService alloc] initWithMediaDeviceProvider:_mediaProvider]; +} + +- (void)tearDown { + [_mediaProvider stopMocking]; + _audioService = nil; + [super tearDown]; +} + +#pragma mark - Tests + +- (void)testThatAudioServiceReturnsNilWhenAudioDeviceAreNil { + // when + NSArray *IDs = [_audioService audioDevicesIDs]; + + // then + XCTAssertNil(IDs); +} + +- (void)testThatAudioServiceReturnsNilWhenAudioDeviceArrayIsEmpty { + // when + NSArray *IDs = [_audioService audioDevicesIDs]; + + // then + XCTAssertNil(IDs); +} + +- (void)testThatAudioServiceReturnsAudioDeviceIDsWhenAudioDeviceArrayIsNotEmpty { + // given + id device = OCMClassMock([AVCaptureDevice class]); + NSArray *array = [[NSMutableArray alloc] initWithObjects:device, nil]; + + OCMStub([(AVCaptureDevice *)device uniqueID]).andReturn(kDeviceID); + OCMStub([self.mediaProvider devicesWithMediaType:[OCMArg any]]).andReturn(array); + + // when + NSArray *IDs = [_audioService audioDevicesIDs]; + + // then + XCTAssertEqual([IDs count], 1); + XCTAssertEqual([IDs firstObject], kDeviceID); +} + +- (void)testThatAudioDeviceIsNotConnectedWhenAudioDeviceDoesNotExist { + // given + OCMStub([self.mediaProvider devicesWithMediaType:[OCMArg any]]).andReturn(nil); + + // when + BOOL isConnected = [self.audioService isAudioDeviceConnected:kDeviceID]; + + // then + XCTAssertFalse(isConnected); +} + +- (void)testThatAudioDeviceIsConnectedWhenAudioDeviceExists { + // given + id device = OCMClassMock([AVCaptureDevice class]); + NSArray *array = [[NSMutableArray alloc] initWithObjects:device, nil]; + + OCMStub([self.mediaProvider devicesWithMediaType:[OCMArg any]]).andReturn(array); + OCMStub([(AVCaptureDevice *)device uniqueID]).andReturn(kDeviceID); + + // when + BOOL isConnected = [self.audioService isAudioDeviceConnected:kDeviceID]; + + // then + XCTAssertTrue(isConnected); +} + +@end diff --git a/CaptureKitTests/NVCaptureConfigurationTests.m b/CaptureKitTests/NVCaptureConfigurationTests.m new file mode 100644 index 0000000..5fe35b5 --- /dev/null +++ b/CaptureKitTests/NVCaptureConfigurationTests.m @@ -0,0 +1,39 @@ +// +// CaptureKitTests +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import "NVCaptureConfiguration.h" + +@interface NVCaptureConfigurationTests : XCTestCase + +@end + +@implementation NVCaptureConfigurationTests + +#pragma mark - Tests + +- (void)testThatConfigurationSetsUpDefaultValues { + // when + NVCaptureConfiguration *configration = [NVCaptureConfiguration default]; + + // then + XCTAssertEqual(configration.fps, 60); + XCTAssertTrue(configration.capturesCursor); + XCTAssertFalse(configration.capturesMouseClicks); + XCTAssertEqual(configration.captureQuality, High); +} + +- (void)testThatConfigurationReturnsTheSameInstanceWhenCopying { + // given + NVCaptureConfiguration *configration = [NVCaptureConfiguration default]; + + // when + NVCaptureConfiguration *copiedConfiguration = [configration copy]; + + // then + XCTAssertEqual(configration, copiedConfiguration); +} + +@end diff --git a/CaptureKitTests/NVCaptureServiceTests.m b/CaptureKitTests/NVCaptureServiceTests.m new file mode 100644 index 0000000..69bee97 --- /dev/null +++ b/CaptureKitTests/NVCaptureServiceTests.m @@ -0,0 +1,252 @@ +// +// CaptureKitTests +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import +#import "NVCaptureService.h" +#import "NVCaptureServiceDelegate.h" +#import "NVDisplayBoundsProvider.h" + +static NSString *const kAudioID = @"audio-id"; + +@interface NVCaptureServiceTests : XCTestCase + +@property(nonatomic, strong) NVCaptureService *captureService; +@property(nonatomic, strong) id captureSessionMock; +@property(nonatomic, strong) id screenInputMock; +@property(nonatomic, strong) id fileOutputMock; +@property(nonatomic, strong) id delegateMock; + +@property(nonatomic, strong) NSURL *sampleURL; +@property(nonatomic, assign) CGRect sampleRect; + +@end + +@implementation NVCaptureServiceTests + +#pragma mark - XCTestCase + +- (void)setUp { + [super setUp]; + _sampleRect = CGRectMake(0, 0, 100, 100); + _sampleURL = [[NSURL alloc] initWithString:@""]; + _captureService = [[NVCaptureService alloc] init]; + [self setupCaptureSessionMock]; + [self setupAudioMock]; + [self setupFileOutputMock]; +} + +- (void)tearDown { + _sampleURL = nil; + _captureService = nil; + [_captureSessionMock stopMocking]; + [_screenInputMock stopMocking]; + [_fileOutputMock stopMocking]; + [super tearDown]; +} + +#pragma mark - Tests + +- (void)testThatCaptureServiceStartsRecordingWithAudioID { + // given + [[_captureSessionMock expect] startRunning]; + [[_fileOutputMock expect] startRecordingToOutputFileURL:_sampleURL + recordingDelegate:[OCMArg any]]; + + // when + [_captureService startRecordingWithAudioDeviceID:kAudioID + rect:_sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:_sampleURL]; + + // then + [_captureSessionMock verify]; + [_fileOutputMock verify]; +} + +- (void)testThatCaptureServiceSetsConfigurationParameters { + // given + OCMExpect([_screenInputMock setCapturesCursor:YES]); + OCMExpect([_screenInputMock setCapturesMouseClicks:NO]); + + // when + [_captureService startRecordingWithAudioDeviceID:kAudioID + rect:_sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:_sampleURL]; + + // when + [_screenInputMock verify]; +} + +- (void)testThatCaptureServiceSetsRightRect { + // given + NSRect rect = CGRectMake(0, 0, 1200, 1800); + id boundsProviderMock = OCMClassMock([NVDisplayBoundsProvider class]); + + OCMStub(ClassMethod([boundsProviderMock sharedInstance])).andReturn(boundsProviderMock); + OCMStub([boundsProviderMock boundsForDisplayWithID:kCGDirectMainDisplay]).andReturn(rect); + + OCMExpect([_screenInputMock setCropRect:CGRectMake(0, 1700, 100, 100)]); + + // when + [_captureService startRecordingWithAudioDeviceID:kAudioID + rect:_sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:_sampleURL]; + + // when + [_screenInputMock verify]; +} + +- (void)testThatCaptureServiceTriggersDelegateWhenRecordingDidStart { + // given + id delegateMock = OCMProtocolMock(@protocol(NVCaptureServiceDelegate)); + [_captureService setDelegate:delegateMock]; + + OCMExpect([delegateMock captureService:[OCMArg any] + didStartRecordingToOutputFileAtURL:[OCMArg any] + fromConnections:[OCMArg any]]); + + // when + [_captureService captureOutput:_fileOutputMock + didStartRecordingToOutputFileAtURL:_sampleURL + fromConnections:[NSArray new]]; + + // then + [delegateMock verify]; +} + +- (void)testThatCaptureServiceTriggersDelegateWhenRecordingDidFinish { + // given + id delegateMock = OCMProtocolMock(@protocol(NVCaptureServiceDelegate)); + [_captureService setDelegate:delegateMock]; + + OCMExpect([delegateMock captureService:[OCMArg any] + didFinishRecordingToOutputFileAtURL:[OCMArg any] + fromConnections:[OCMArg any] + error:[OCMArg any]]); + + // when + [_captureService captureOutput:_fileOutputMock + didFinishRecordingToOutputFileAtURL:_sampleURL + fromConnections:[NSArray new] + error:nil]; + + // then + [delegateMock verify]; +} + +- (void)testThatCaptureServiceTriggersDelegateWhenRecordingDidResume { + // given + id delegateMock = OCMProtocolMock(@protocol(NVCaptureServiceDelegate)); + [_captureService setDelegate:delegateMock]; + + OCMExpect([delegateMock captureService:[OCMArg any] + didResumeRecordingToOutputFileAtURL:[OCMArg any] + fromConnections:[OCMArg any]]); + + // when + [_captureService captureOutput:_fileOutputMock + didResumeRecordingToOutputFileAtURL:_sampleURL + fromConnections:[NSArray new]]; + + // then + [delegateMock verify]; +} + +- (void)testThatCaptureServiceTriggersDelegateWhenRecordingDidPause { + // given + id delegateMock = OCMProtocolMock(@protocol(NVCaptureServiceDelegate)); + [_captureService setDelegate:delegateMock]; + + OCMExpect([delegateMock captureService:[OCMArg any] + didPauseRecordingToOutputFileAtURL:[OCMArg any] + fromConnections:[OCMArg any]]); + + // when + [_captureService captureOutput:_fileOutputMock + didPauseRecordingToOutputFileAtURL:_sampleURL + fromConnections:[NSArray new]]; + + // then + [delegateMock verify]; +} + +- (void)testThatCaptureServiceStopsRecordingWhenRecordingIsActive { + // given + OCMStub([_fileOutputMock isRecording]).andReturn(YES); + + OCMExpect([_fileOutputMock stopRecording]); + OCMExpect(([_captureSessionMock stopRunning])); + + // when + [_captureService startRecordingWithAudioDeviceID:kAudioID + rect:_sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:_sampleURL]; + [_captureService stop]; + + // then + [_captureSessionMock verify]; + [_fileOutputMock verify]; +} + +- (void)testThatCaptureServicePausesRecordingWhenRecordingIsActive { + // given + OCMStub([_fileOutputMock isRecording]).andReturn(YES); + + OCMExpect([_fileOutputMock pauseRecording]); + + // when + [_captureService startRecordingWithAudioDeviceID:kAudioID + rect:_sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:_sampleURL]; + [_captureService pause]; + + // then + [_fileOutputMock verify]; +} + +- (void)testThatCaptureServiceResumesRecordingWhenRecordingIsActive { + // given + OCMStub([_fileOutputMock isRecording]).andReturn(YES); + + OCMExpect([_fileOutputMock resumeRecording]); + + // when + [_captureService startRecordingWithAudioDeviceID:kAudioID + rect:_sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:_sampleURL]; + [_captureService resume]; + + // then + [_fileOutputMock verify]; +} + +#pragma mark - Private + +- (void)setupCaptureSessionMock { + id captureSessionMock = OCMClassMock([AVCaptureSession class]); + OCMStub([captureSessionMock alloc]).andReturn(captureSessionMock); + _captureSessionMock = captureSessionMock; +} + +- (void)setupAudioMock { + id screenInputMock = OCMClassMock([AVCaptureScreenInput class]); + OCMStub([screenInputMock alloc]).andReturn(screenInputMock); + OCMStub([screenInputMock initWithDisplayID:kCGDirectMainDisplay]).andReturn(screenInputMock); + _screenInputMock = screenInputMock; +} + +- (void)setupFileOutputMock { + id fileOutputMock = OCMClassMock([AVCaptureMovieFileOutput class]); + OCMStub([fileOutputMock alloc]).andReturn(fileOutputMock); + _fileOutputMock = fileOutputMock; +} + +@end diff --git a/CaptureKitTests/NVMediaDeviceProviderTests.m b/CaptureKitTests/NVMediaDeviceProviderTests.m new file mode 100644 index 0000000..a78d9ad --- /dev/null +++ b/CaptureKitTests/NVMediaDeviceProviderTests.m @@ -0,0 +1,50 @@ +// +// CaptureKitTests +// Copyright © 2023 Space Code. All rights reserved. +// + +#import +#import +#import + +#import "NVMediaDeviceProvider.h" + +@interface NVMediaDeviceProviderTests : XCTestCase + +@property(nonatomic, strong) id captureDevice; +@property(nonatomic, strong) NVMediaDeviceProvider *deviceProvider; + +@end + +@implementation NVMediaDeviceProviderTests + +#pragma mark - Initialization + +- (void)setUp { + [super setUp]; + _captureDevice = OCMClassMock([AVCaptureDevice class]); + _deviceProvider = [[NVMediaDeviceProvider alloc] init]; +} + +- (void)tearDown { + _deviceProvider = nil; + [_captureDevice stopMocking]; + [super tearDown]; +} + +#pragma mark - Tests + +- (void)testThatMediaDeviceProviderProvidesDevicesWithGivenMediaType { + // given + id classMock = OCMClassMock([AVCaptureDevice class]); + NSArray *devices = [[NSArray alloc] initWithObjects:_captureDevice, nil]; + OCMStub(ClassMethod([classMock devicesWithMediaType:[OCMArg any]])).andReturn(devices); + + // when + NSArray *result = [_deviceProvider devicesWithMediaType:AVMediaTypeAudio]; + + // then + XCTAssertEqual(devices, result); +} + +@end diff --git a/Dangerfile b/Dangerfile new file mode 100644 index 0000000..b266982 --- /dev/null +++ b/Dangerfile @@ -0,0 +1 @@ +danger.import_dangerfile(github: 'space-code/dangerfile') \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..20dff64 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem 'danger' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..43236ba --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,66 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.5) + public_suffix (>= 2.0.2, < 6.0) + base64 (0.1.1) + claide (1.1.0) + claide-plugins (0.9.2) + cork + nap + open4 (~> 1.3) + colored2 (3.1.2) + cork (0.3.0) + colored2 (~> 3.1) + danger (9.3.2) + claide (~> 1.0) + claide-plugins (>= 0.9.2) + colored2 (~> 3.1) + cork (~> 0.1) + faraday (>= 0.9.0, < 3.0) + faraday-http-cache (~> 2.0) + git (~> 1.13) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.0) + no_proxy_fix + octokit (~> 6.0) + terminal-table (>= 1, < 4) + faraday (2.7.11) + base64 + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-http-cache (2.5.0) + faraday (>= 0.8) + faraday-net_http (3.0.2) + git (1.18.0) + addressable (~> 2.8) + rchardet (~> 1.8) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + nap (1.1.0) + no_proxy_fix (0.1.2) + octokit (6.1.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + open4 (1.3.4) + public_suffix (5.0.3) + rchardet (1.8.0) + rexml (3.2.6) + ruby2_keywords (0.0.5) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.5.0) + +PLATFORMS + x86_64-darwin-22 + +DEPENDENCIES + danger + +BUNDLED WITH + 2.4.21 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..680e417 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: bootstrap + +bootstrap: hook brew + +brew: + brew bundle check || brew bundle + +hook: + ln -sf ../../hooks/pre-commit .git/hooks/pre-commit + chmod +x .git/hooks/pre-commit + +fmt: + find CaptureKit -iname '*.h' -o -iname '*.m' | xargs clang-format -i + find CaptureKitTests -iname '*.h' -o -iname '*.m' | xargs clang-format -i + +.PHONY: all bootstrap hook brew mint lint fmt \ No newline at end of file diff --git a/README.md b/README.md index 7d61bfe..26c10f2 100644 --- a/README.md +++ b/README.md @@ -1 +1,91 @@ -# capture-kit \ No newline at end of file +![capture-kit: a framework written in Objective-C that provides functions that can be used to capture the contents of a screen](https://raw.githubusercontent.com/space-code/capture-kit/dev/Resources/capture-kit.png) + +

capture-kit

+ +

+Liscence +CI +CodeCov +

+ +## Description +`capture-kit` is a framework written in Objective-C that provides functions that can be used to capture the contents of a screen. + +- [Usage](#usage) +- [Requirements](#requirements) +- [Communication](#communication) +- [Contributing](#contributing) +- [Author](#author) +- [License](#license) + +## Usage + +1. Create a new instance of `NVCaptureService` that encompasses screen capturing functionality. + +```objc +NVCaptureService *captureService = [[NVCaptureService alloc] init]; +``` + +2. Set a delegate to receive recording-related events: + +```objc +captureService.delegate = self; +``` + +3. An optional step: If you want to capture microphone sound, you need to obtain a microphone ID. To do this, create a new instance of `NVAudioService` that provides a list of connected device IDs. + +```objc +NVAudioService *audioService = [[NVAudioService alloc] initWithMediaDeviceProvider:[NVMediaDeviceProvider new]]; +NSArray *ids = [audioService audioDevicesIDs]; +``` + +You can also check whether an audio device is connected to the system like this: +```objc +BOOL isConnected = [audioService isAudioDeviceConnected:@""]; +``` + +4. Start screen capture + +```objc +NSRect sampleRect = CGRectMake(0, 0, 1200, 1800); +NSURL *sampleURL = [[NSURL alloc] initWithString:@"file_url"]; + +[_captureService startRecordingWithAudioDeviceID:@"" + rect:sampleRect + directDisplayID:kCGDirectMainDisplay + outputFileURL:sampleURL]; +``` + +Also, you can pass a custom capture configuration using ```objc - (void)startRecordingWithConfiguration:deviceID:rect:directDisplayID:outputFileURL:``` + +5. For pausing, resuming, and cancelling, you can use the following methods: + +```objc +- (void)pause +- (void)resume +- (void)stop +``` + +## Requirements +- macOS 11.0+ +- Xcode 14.0 + +## Communication +- If you **found a bug**, open an issue. +- If you **have a feature request**, open an issue. +- If you **want to contribute**, submit a pull request. + +## Contributing +Bootstrapping development environment + +``` +make bootstrap +``` + +Please feel free to help out with this project! If you see something that could be made better or want a new feature, open up an issue or send a Pull Request! + +## Author +Nikita Vasilev, nv3212@gmail.com + +## License +capture-kit is available under the MIT license. See the LICENSE file for more info. \ No newline at end of file diff --git a/Resources/capture-kit.png b/Resources/capture-kit.png new file mode 100644 index 0000000..847adcc Binary files /dev/null and b/Resources/capture-kit.png differ diff --git a/ThirdParty/OCMock.xcframework/Info.plist b/ThirdParty/OCMock.xcframework/Info.plist new file mode 100644 index 0000000..e58df1a --- /dev/null +++ b/ThirdParty/OCMock.xcframework/Info.plist @@ -0,0 +1,141 @@ + + + + + AvailableLibraries + + + BinaryPath + OCMock.framework/OCMock + LibraryIdentifier + tvos-arm64_x86_64-simulator + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + tvos + SupportedPlatformVariant + simulator + + + BinaryPath + OCMock.framework/OCMock + LibraryIdentifier + ios-arm64 + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + OCMock.framework/OCMock + LibraryIdentifier + watchos-arm64_i386_x86_64-simulator + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + i386 + x86_64 + + SupportedPlatform + watchos + SupportedPlatformVariant + simulator + + + BinaryPath + OCMock.framework/OCMock + LibraryIdentifier + watchos-arm64_arm64_32_armv7k + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + arm64_32 + armv7k + + SupportedPlatform + watchos + + + BinaryPath + OCMock.framework/OCMock + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + OCMock.framework/Versions/A/OCMock + LibraryIdentifier + ios-arm64_x86_64-maccatalyst + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + maccatalyst + + + BinaryPath + OCMock.framework/Versions/A/OCMock + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + + + BinaryPath + OCMock.framework/OCMock + LibraryIdentifier + tvos-arm64 + LibraryPath + OCMock.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + tvos + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMVerifier.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMVerifier.h new file mode 100644 index 0000000..217acdb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMVerifier.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; + +@interface OCMVerifier : OCMRecorder + +@property(strong) OCMLocation *location; +@property(strong) OCMQuantifier *quantifier; + +- (id)withQuantifier:(OCMQuantifier *)quantifier; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Info.plist b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Info.plist new file mode 100644 index 0000000..10df572 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Info.plist differ diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/OCMock new file mode 100755 index 0000000..6524030 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..7e9b5a2 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64/OCMock.framework/_CodeSignature/CodeResources @@ -0,0 +1,256 @@ + + + + + files + + Headers/NSNotificationCenter+OCMAdditions.h + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + Headers/OCMArg.h + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + Headers/OCMConstraint.h + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + Headers/OCMFunctions.h + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + Headers/OCMLocation.h + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + Headers/OCMMacroState.h + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + Headers/OCMQuantifier.h + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + Headers/OCMRecorder.h + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + Headers/OCMStubRecorder.h + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + Headers/OCMVerifier.h + + XkRNOUntVvz91+zCRZHKop6Mpm4= + + Headers/OCMock.h + + On/6fINORTxTz9S5hDINgwB7Q+k= + + Headers/OCMockMacros.h + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + Headers/OCMockObject.h + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + Info.plist + + khj9sscz1vARhlRjRaESGMUgSao= + + Modules/module.modulemap + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMVerifier.h + + hash2 + + AX+jq2RcKI06XrCgrYSS5p4CGtyEdt0fNSLdsUkOmjk= + + + Headers/OCMock.h + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Headers b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Modules b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/OCMock new file mode 120000 index 0000000..c388ea8 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/OCMock @@ -0,0 +1 @@ +Versions/Current/OCMock \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Resources b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMVerifier.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMVerifier.h new file mode 100644 index 0000000..217acdb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMVerifier.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; + +@interface OCMVerifier : OCMRecorder + +@property(strong) OCMLocation *location; +@property(strong) OCMQuantifier *quantifier; + +- (id)withQuantifier:(OCMQuantifier *)quantifier; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/OCMock b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/OCMock new file mode 100755 index 0000000..b1e2d88 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Resources/Info.plist b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..a71880d --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,54 @@ + + + + + BuildMachineOSBuild + 22G120 + CFBundleDevelopmentRegion + en + CFBundleExecutable + OCMock + CFBundleIdentifier + org.ocmock.OCMock + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + OCMock + CFBundlePackageType + FMWK + CFBundleShortVersionString + 3.9.2 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 3.9.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + + DTPlatformName + macosx + DTPlatformVersion + 14.0 + DTSDKBuild + 23A334 + DTSDKName + macosx14.0 + DTXcode + 1500 + DTXcodeBuild + 15A240d + LSMinimumSystemVersion + 10.15 + NSHumanReadableCopyright + Copyright © 2004-2023 Erik Doernenburg and contributors + UIDeviceFamily + + 2 + + + diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/_CodeSignature/CodeResources new file mode 100644 index 0000000..e091008 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/A/_CodeSignature/CodeResources @@ -0,0 +1,226 @@ + + + + + files + + Resources/Info.plist + + EfVyotcYsdKuoly21trbNj2ErGQ= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMVerifier.h + + hash2 + + AX+jq2RcKI06XrCgrYSS5p4CGtyEdt0fNSLdsUkOmjk= + + + Headers/OCMock.h + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + Resources/Info.plist + + hash2 + + kym37FgNIKY2omZ9UcPItLhI7lSyt6is4iXeY4iAegw= + + + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/Current b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-maccatalyst/OCMock.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMVerifier.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMVerifier.h new file mode 100644 index 0000000..217acdb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMVerifier.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; + +@interface OCMVerifier : OCMRecorder + +@property(strong) OCMLocation *location; +@property(strong) OCMQuantifier *quantifier; + +- (id)withQuantifier:(OCMQuantifier *)quantifier; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Info.plist b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Info.plist new file mode 100644 index 0000000..553916c Binary files /dev/null and b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Info.plist differ diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/OCMock new file mode 100755 index 0000000..27c8c82 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..7e67685 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/ios-arm64_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources @@ -0,0 +1,256 @@ + + + + + files + + Headers/NSNotificationCenter+OCMAdditions.h + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + Headers/OCMArg.h + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + Headers/OCMConstraint.h + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + Headers/OCMFunctions.h + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + Headers/OCMLocation.h + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + Headers/OCMMacroState.h + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + Headers/OCMQuantifier.h + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + Headers/OCMRecorder.h + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + Headers/OCMStubRecorder.h + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + Headers/OCMVerifier.h + + XkRNOUntVvz91+zCRZHKop6Mpm4= + + Headers/OCMock.h + + On/6fINORTxTz9S5hDINgwB7Q+k= + + Headers/OCMockMacros.h + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + Headers/OCMockObject.h + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + Info.plist + + GuDeeeA7YdNA2JQefpl6K5/f+bc= + + Modules/module.modulemap + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMVerifier.h + + hash2 + + AX+jq2RcKI06XrCgrYSS5p4CGtyEdt0fNSLdsUkOmjk= + + + Headers/OCMock.h + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Headers b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Modules b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/OCMock new file mode 120000 index 0000000..c388ea8 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/OCMock @@ -0,0 +1 @@ +Versions/Current/OCMock \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Resources b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMVerifier.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMVerifier.h new file mode 100644 index 0000000..217acdb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMVerifier.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; + +@interface OCMVerifier : OCMRecorder + +@property(strong) OCMLocation *location; +@property(strong) OCMQuantifier *quantifier; + +- (id)withQuantifier:(OCMQuantifier *)quantifier; + +@end diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/OCMock b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/OCMock new file mode 100755 index 0000000..d3be456 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Resources/Info.plist b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..9bd2568 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,50 @@ + + + + + BuildMachineOSBuild + 22G120 + CFBundleDevelopmentRegion + en + CFBundleExecutable + OCMock + CFBundleIdentifier + org.ocmock.OCMock + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + OCMock + CFBundlePackageType + FMWK + CFBundleShortVersionString + 3.9.2 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 3.9.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + + DTPlatformName + macosx + DTPlatformVersion + 14.0 + DTSDKBuild + 23A334 + DTSDKName + macosx14.0 + DTXcode + 1500 + DTXcodeBuild + 15A240d + LSMinimumSystemVersion + 10.15 + NSHumanReadableCopyright + Copyright © 2004-2023 Erik Doernenburg and contributors + + diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/_CodeSignature/CodeResources new file mode 100644 index 0000000..a35c9c8 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/A/_CodeSignature/CodeResources @@ -0,0 +1,226 @@ + + + + + files + + Resources/Info.plist + + Z2yDR+vCPoAYMl5zJZIBl6A9ksA= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMVerifier.h + + hash2 + + AX+jq2RcKI06XrCgrYSS5p4CGtyEdt0fNSLdsUkOmjk= + + + Headers/OCMock.h + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + Resources/Info.plist + + hash2 + + q1bOZ86+MFIEpymG7syD7+N1tBaLoc6Vn7ZBb/57CjM= + + + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/Current b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/macos-arm64_x86_64/OCMock.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMVerifier.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMVerifier.h new file mode 100644 index 0000000..217acdb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMVerifier.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; + +@interface OCMVerifier : OCMRecorder + +@property(strong) OCMLocation *location; +@property(strong) OCMQuantifier *quantifier; + +- (id)withQuantifier:(OCMQuantifier *)quantifier; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Info.plist b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Info.plist new file mode 100644 index 0000000..9bd9078 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Info.plist differ diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/OCMock new file mode 100755 index 0000000..9d9745f Binary files /dev/null and b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..be19c99 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64/OCMock.framework/_CodeSignature/CodeResources @@ -0,0 +1,256 @@ + + + + + files + + Headers/NSNotificationCenter+OCMAdditions.h + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + Headers/OCMArg.h + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + Headers/OCMConstraint.h + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + Headers/OCMFunctions.h + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + Headers/OCMLocation.h + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + Headers/OCMMacroState.h + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + Headers/OCMQuantifier.h + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + Headers/OCMRecorder.h + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + Headers/OCMStubRecorder.h + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + Headers/OCMVerifier.h + + XkRNOUntVvz91+zCRZHKop6Mpm4= + + Headers/OCMock.h + + On/6fINORTxTz9S5hDINgwB7Q+k= + + Headers/OCMockMacros.h + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + Headers/OCMockObject.h + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + Info.plist + + B4BX2PVKrrwNNy3T3zPfHf0+pzk= + + Modules/module.modulemap + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMVerifier.h + + hash2 + + AX+jq2RcKI06XrCgrYSS5p4CGtyEdt0fNSLdsUkOmjk= + + + Headers/OCMock.h + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMVerifier.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMVerifier.h new file mode 100644 index 0000000..217acdb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMVerifier.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; + +@interface OCMVerifier : OCMRecorder + +@property(strong) OCMLocation *location; +@property(strong) OCMQuantifier *quantifier; + +- (id)withQuantifier:(OCMQuantifier *)quantifier; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Info.plist b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Info.plist new file mode 100644 index 0000000..e8cf991 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Info.plist differ diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/OCMock new file mode 100755 index 0000000..f6772a1 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..28eaa58 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/tvos-arm64_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources @@ -0,0 +1,256 @@ + + + + + files + + Headers/NSNotificationCenter+OCMAdditions.h + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + Headers/OCMArg.h + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + Headers/OCMConstraint.h + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + Headers/OCMFunctions.h + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + Headers/OCMLocation.h + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + Headers/OCMMacroState.h + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + Headers/OCMQuantifier.h + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + Headers/OCMRecorder.h + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + Headers/OCMStubRecorder.h + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + Headers/OCMVerifier.h + + XkRNOUntVvz91+zCRZHKop6Mpm4= + + Headers/OCMock.h + + On/6fINORTxTz9S5hDINgwB7Q+k= + + Headers/OCMockMacros.h + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + Headers/OCMockObject.h + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + Info.plist + + ypwSWa/twhdFOU1u7aTfsK/n/1k= + + Modules/module.modulemap + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMVerifier.h + + hash2 + + AX+jq2RcKI06XrCgrYSS5p4CGtyEdt0fNSLdsUkOmjk= + + + Headers/OCMock.h + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Info.plist b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Info.plist new file mode 100644 index 0000000..5c16027 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Info.plist differ diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/OCMock new file mode 100755 index 0000000..a443ac5 Binary files /dev/null and b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..50ec80d --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_arm64_32_armv7k/OCMock.framework/_CodeSignature/CodeResources @@ -0,0 +1,297 @@ + + + + + files + + Headers/NSNotificationCenter+OCMAdditions.h + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + Headers/OCMArg.h + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + Headers/OCMConstraint.h + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + Headers/OCMFunctions.h + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + Headers/OCMLocation.h + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + Headers/OCMMacroState.h + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + Headers/OCMQuantifier.h + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + Headers/OCMRecorder.h + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + Headers/OCMStubRecorder.h + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + Headers/OCMock.h + + On/6fINORTxTz9S5hDINgwB7Q+k= + + Headers/OCMockMacros.h + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + Headers/OCMockObject.h + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + Info.plist + + 6FJ2NxALUEytn6HUUz81+ZvLtdI= + + Modules/module.modulemap + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMock.h + + hash + + On/6fINORTxTz9S5hDINgwB7Q+k= + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h new file mode 100644 index 0000000..8f6d56f --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/NSNotificationCenter+OCMAdditions.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCObserverMockObject; + + +@interface NSNotificationCenter(OCMAdditions) + +- (void)addMockObserver:(OCObserverMockObject *)notificationObserver name:(NSString *)notificationName object:(id)notificationSender; + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMArg.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMArg.h new file mode 100644 index 0000000..2716707 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMArg.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2009-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMArg : NSObject + +// constraining arguments + ++ (id)any; ++ (SEL)anySelector; ++ (void *)anyPointer; ++ (id __autoreleasing *)anyObjectRef; ++ (id)isNil; ++ (id)isNotNil; ++ (id)isEqual:(id)value; ++ (id)isNotEqual:(id)value; ++ (id)isKindOfClass:(Class)cls; ++ (id)checkWithSelector:(SEL)selector onObject:(id)anObject; ++ (id)checkWithBlock:(BOOL (^)(id obj))block; + +// manipulating arguments + ++ (id *)setTo:(id)value; ++ (void *)setToValue:(NSValue *)value; ++ (id)invokeBlock; ++ (id)invokeBlockWithArgs:(id)first, ... NS_REQUIRES_NIL_TERMINATION; + ++ (id)defaultValue; + +// internal use only + ++ (id)resolveSpecialValues:(NSValue *)value; + +@end + +#define OCMOCK_ANY [OCMArg any] + +#define OCMOCK_VALUE(variable) \ + ({ __typeof__(variable) __v = (variable); [NSValue value:&__v withObjCType:@encode(__typeof__(__v))]; }) diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h new file mode 100644 index 0000000..39714db --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMConstraint.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2007-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMConstraint : NSObject + ++ (instancetype)constraint; +- (BOOL)evaluate:(id)value; + +// if you are looking for any, isNil, etc, they have moved to OCMArg + +// try to use [OCMArg checkWith...] instead of the constraintWith... methods below + ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject; ++ (instancetype)constraintWithSelector:(SEL)aSelector onObject:(id)anObject withValue:(id)aValue; + + +@end + +@interface OCMAnyConstraint : OCMConstraint +@end + +@interface OCMIsNilConstraint : OCMConstraint +@end + +@interface OCMIsNotNilConstraint : OCMConstraint +@end + +@interface OCMIsNotEqualConstraint : OCMConstraint +{ +@public + id testValue; +} + +@end + +@interface OCMInvocationConstraint : OCMConstraint +{ +@public + NSInvocation *invocation; +} + +@end + +@interface OCMBlockConstraint : OCMConstraint +{ + BOOL (^block)(id); +} + +- (instancetype)initWithConstraintBlock:(BOOL (^)(id))block; + +@end + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define CONSTRAINT(aSelector) [OCMConstraint constraintWithSelector:aSelector onObject:self] +#define CONSTRAINTV(aSelector, aValue) [OCMConstraint constraintWithSelector:aSelector onObject:self withValue:(aValue)] +#endif diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h new file mode 100644 index 0000000..15131ae --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMFunctions.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + + +#if defined(__cplusplus) +#define OCMOCK_EXTERN extern "C" +#else +#define OCMOCK_EXTERN extern +#endif + + +OCMOCK_EXTERN BOOL OCMIsObjectType(const char *objCType); +OCMOCK_EXTERN BOOL OCMIsSubclassOfMockClass(Class cls); diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h new file mode 100644 index 0000000..b14a8eb --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMLocation.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +@interface OCMLocation : NSObject +{ + id testCase; + NSString *file; + NSUInteger line; +} + ++ (instancetype)locationWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (instancetype)initWithTestCase:(id)aTestCase file:(NSString *)aFile line:(NSUInteger)aLine; + +- (id)testCase; +- (NSString *)file; +- (NSUInteger)line; + +@end + +OCMOCK_EXTERN OCMLocation *OCMMakeLocation(id testCase, const char *file, int line); diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h new file mode 100644 index 0000000..5b32fab --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMMacroState.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMRecorder; +@class OCMStubRecorder; +@class OCMockObject; + + +@interface OCMMacroState : NSObject +{ + OCMRecorder *recorder; + BOOL invocationDidThrow; +} + ++ (void)beginStubMacro; ++ (OCMStubRecorder *)endStubMacro; + ++ (void)beginExpectMacro; ++ (OCMStubRecorder *)endExpectMacro; + ++ (void)beginRejectMacro; ++ (OCMStubRecorder *)endRejectMacro; + ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation; ++ (void)beginVerifyMacroAtLocation:(OCMLocation *)aLocation withQuantifier:(OCMQuantifier *)quantifier; ++ (void)endVerifyMacro; + ++ (OCMMacroState *)globalState; + +- (void)setRecorder:(OCMRecorder *)aRecorder; +- (OCMRecorder *)recorder; + +- (void)switchToClassMethod; + +- (void)setInvocationDidThrow:(BOOL)flag; +- (BOOL)invocationDidThrow; + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h new file mode 100644 index 0000000..c013bde --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMQuantifier.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface OCMQuantifier : NSObject +{ + NSUInteger expectedCount; +} + ++ (instancetype)never; ++ (instancetype)exactly:(NSUInteger)count; ++ (instancetype)atLeast:(NSUInteger)count; ++ (instancetype)atMost:(NSUInteger)count; + +- (BOOL)isValidCount:(NSUInteger)count; + +- (NSString *)description; + +@end + + +#define OCMNever() ([OCMQuantifier never]) +#define OCMTimes(n) ([OCMQuantifier exactly:(n)]) +#define OCMAtLeast(n) ([OCMQuantifier atLeast:(n)]) +#define OCMAtMost(n) ([OCMQuantifier atMost:(n)]) + +#ifndef OCM_DISABLE_SHORT_QSYNTAX +#define never() OCMNever() +#define times(n) OCMTimes(n) +#define atLeast(n) OCMAtLeast(n) +#define atMost(n) OCMAtMost(n) +#endif diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h new file mode 100644 index 0000000..5106445 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMRecorder.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMockObject; +@class OCMInvocationMatcher; + + +@interface OCMRecorder : NSProxy +{ + OCMockObject *mockObject; + OCMInvocationMatcher *invocationMatcher; + BOOL didRecordInvocation; + BOOL shouldReturnMockFromInit; +} + +- (instancetype)init; +- (instancetype)initWithMockObject:(OCMockObject *)aMockObject; + +- (void)setMockObject:(OCMockObject *)aMockObject; +- (void)setShouldReturnMockFromInit:(BOOL)flag; + +- (OCMInvocationMatcher *)invocationMatcher; +- (BOOL)didRecordInvocation; + +- (id)classMethod; +- (id)ignoringNonObjectArgs; + +@end + +@interface OCMRecorder (Properties) + +#define ignoringNonObjectArgs() _ignoringNonObjectArgs() +@property(nonatomic, readonly) OCMRecorder * (^_ignoringNonObjectArgs)(void); + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h new file mode 100644 index 0000000..a00c64b --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMStubRecorder.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import + +#import + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +@class XCTestExpectation; +#endif + +@interface OCMStubRecorder : OCMRecorder + +- (id)andReturn:(id)anObject; +- (id)andReturnValue:(NSValue *)aValue; +- (id)andThrow:(NSException *)anException; +- (id)andPost:(NSNotification *)aNotification; +- (id)andCall:(SEL)selector onObject:(id)anObject; +- (id)andDo:(void (^)(NSInvocation *invocation))block; +- (id)andForwardToRealObject; + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +- (id)andFulfill:(XCTestExpectation *)expectation; +#endif + +@end + + +@interface OCMStubRecorder (Properties) + +#define andReturn(aValue) _andReturn(({ \ + __typeof__(aValue) _val = (aValue); \ + NSValue *_nsval = [NSValue value:&_val withObjCType:@encode(__typeof__(_val))]; \ + if (OCMIsObjectType(@encode(__typeof(_val)))) { \ + objc_setAssociatedObject(_nsval, "OCMAssociatedBoxedValue", *(__unsafe_unretained id *) (void *) &_val, OBJC_ASSOCIATION_RETAIN); \ + } \ + _nsval; \ +})) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andReturn)(NSValue *); + +#define andThrow(anException) _andThrow(anException) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andThrow)(NSException *); + +#define andPost(aNotification) _andPost(aNotification) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andPost)(NSNotification *); + +#define andCall(anObject, aSelector) _andCall(anObject, aSelector) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andCall)(id, SEL); + +#define andDo(aBlock) _andDo(aBlock) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andDo)(void (^)(NSInvocation *)); + +#define andForwardToRealObject() _andForwardToRealObject() +@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void); + +#if !defined(OCM_DISABLE_XCTEST_FEATURES) +#define andFulfill(anExpectation) _andFulfill(anExpectation) +@property (nonatomic, readonly) OCMStubRecorder *(^ _andFulfill)(XCTestExpectation *); +#endif + +@property (nonatomic, readonly) OCMStubRecorder *(^ _ignoringNonObjectArgs)(void); + +#define andBreak() _andDo(^(NSInvocation *_invocation) \ +{ \ + __builtin_debugtrap(); \ +}) \ + +#define andLog(_format, ...) _andDo(^(NSInvocation *_invocation) \ +{ \ + NSLog(_format, ##__VA_ARGS__); \ +}) \ + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMock.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMock.h new file mode 100644 index 0000000..f636572 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMock.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h new file mode 100644 index 0000000..2253557 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMockMacros.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + + + +#ifdef OCM_DISABLE_SHORT_SYNTAX +#define OCM_DISABLE_SHORT_QSYNTAX +#endif + + +#define OCMClassMock(cls) [OCMockObject niceMockForClass:cls] + +#define OCMStrictClassMock(cls) [OCMockObject mockForClass:cls] + +#define OCMProtocolMock(protocol) [OCMockObject niceMockForProtocol:protocol] + +#define OCMStrictProtocolMock(protocol) [OCMockObject mockForProtocol:protocol] + +#define OCMPartialMock(obj) [OCMockObject partialMockForObject:obj] + +#define OCMObserverMock() [OCMockObject observerMock] + + +#define OCMStub(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginStubMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endStubMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMExpect(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginExpectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endExpectMacro]; \ + } \ + recorder; \ + ); \ +}) + +#define OCMReject(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginRejectMacro]; \ + OCMStubRecorder *recorder = nil; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + recorder = [OCMMacroState endRejectMacro]; \ + } \ + recorder; \ + ); \ +}) + + + +#define OCMClassMethod(invocation) \ + _OCMSilenceWarnings( \ + [[OCMMacroState globalState] switchToClassMethod]; \ + invocation; \ + ); + + +#ifndef OCM_DISABLE_SHORT_SYNTAX +#define ClassMethod(invocation) OCMClassMethod(invocation) +#endif + + +#define OCMVerifyAll(mock) [(OCMockObject *)mock verifyAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define OCMVerifyAllWithDelay(mock, delay) [(OCMockObject *)mock verifyWithDelay:delay atLocation:OCMMakeLocation(self, __FILE__, __LINE__)] + +#define _OCMVerify(invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__)]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +#define _OCMVerifyWithQuantifier(quantifier, invocation) \ +({ \ + _OCMSilenceWarnings( \ + [OCMMacroState beginVerifyMacroAtLocation:OCMMakeLocation(self, __FILE__, __LINE__) withQuantifier:quantifier]; \ + @try{ \ + invocation; \ + }@catch(...){ \ + [[OCMMacroState globalState] setInvocationDidThrow:YES]; \ + /* NOLINTNEXTLINE(google-objc-avoid-throwing-exception) */ \ + @throw; \ + }@finally{ \ + [OCMMacroState endVerifyMacro]; \ + } \ + ); \ +}) + +// explanation for macros below here: https://stackoverflow.com/questions/3046889/optional-parameters-with-c-macros + +#define _OCMVerify_1(A) _OCMVerify(A) +#define _OCMVerify_2(A,B) _OCMVerifyWithQuantifier(A, B) +#define _OCMVerify_X(x,A,B,FUNC, ...) FUNC +#define OCMVerify(...) _OCMVerify_X(,##__VA_ARGS__, _OCMVerify_2(__VA_ARGS__), _OCMVerify_1(__VA_ARGS__)) + + +#define _OCMSilenceWarnings(macro) \ +({ \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-getter-return-value\"") \ + _Pragma("clang diagnostic ignored \"-Wstrict-selector-match\"") \ + macro \ + _Pragma("clang diagnostic pop") \ +}) diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h new file mode 100644 index 0000000..f573971 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Headers/OCMockObject.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2021 Erik Doernenburg and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use these files except in compliance with the License. You may obtain + * a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +#import + +@class OCMLocation; +@class OCMQuantifier; +@class OCMInvocationStub; +@class OCMStubRecorder; +@class OCMInvocationMatcher; +@class OCMInvocationExpectation; + + +@interface OCMockObject : NSProxy +{ + BOOL isNice; + BOOL expectationOrderMatters; + NSMutableArray *stubs; + NSMutableArray *expectations; + NSMutableArray *exceptions; + NSMutableArray *invocations; +} + ++ (id)mockForClass:(Class)aClass; ++ (id)mockForProtocol:(Protocol *)aProtocol; ++ (id)partialMockForObject:(NSObject *)anObject; + ++ (id)niceMockForClass:(Class)aClass; ++ (id)niceMockForProtocol:(Protocol *)aProtocol; + ++ (id)observerMock __deprecated_msg("Please use XCTNSNotificationExpectation instead."); + +- (instancetype)init; + +- (void)setExpectationOrderMatters:(BOOL)flag; + +- (id)stub; +- (id)expect; +- (id)reject; + +- (id)verify; +- (id)verifyAtLocation:(OCMLocation *)location; + +- (void)verifyWithDelay:(NSTimeInterval)delay; +- (void)verifyWithDelay:(NSTimeInterval)delay atLocation:(OCMLocation *)location; + +- (void)stopMocking; + +// internal use only + +- (void)addStub:(OCMInvocationStub *)aStub; +- (void)addExpectation:(OCMInvocationExpectation *)anExpectation; +- (void)addInvocation:(NSInvocation *)anInvocation; + +- (BOOL)handleInvocation:(NSInvocation *)anInvocation; +- (void)handleUnRecordedInvocation:(NSInvocation *)anInvocation; +- (BOOL)handleSelector:(SEL)sel; + +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher atLocation:(OCMLocation *)location; +- (void)verifyInvocation:(OCMInvocationMatcher *)matcher withQuantifier:(OCMQuantifier *)quantifier atLocation:(OCMLocation *)location; +- (NSString *)descriptionForVerificationFailureWithMatcher:(OCMInvocationMatcher *)matcher quantifier:(OCMQuantifier *)quantifier invocationCount:(NSUInteger)count; + +@end diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Info.plist b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Info.plist new file mode 100644 index 0000000..a64c05b Binary files /dev/null and b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Info.plist differ diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Modules/module.modulemap b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Modules/module.modulemap new file mode 100644 index 0000000..fab3ca5 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module OCMock { + umbrella header "OCMock.h" + export * + + module * { export * } +} diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/OCMock b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/OCMock new file mode 100755 index 0000000..839420f Binary files /dev/null and b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/OCMock differ diff --git a/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..64abb31 --- /dev/null +++ b/ThirdParty/OCMock.xcframework/watchos-arm64_i386_x86_64-simulator/OCMock.framework/_CodeSignature/CodeResources @@ -0,0 +1,297 @@ + + + + + files + + Headers/NSNotificationCenter+OCMAdditions.h + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + Headers/OCMArg.h + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + Headers/OCMConstraint.h + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + Headers/OCMFunctions.h + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + Headers/OCMLocation.h + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + Headers/OCMMacroState.h + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + Headers/OCMQuantifier.h + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + Headers/OCMRecorder.h + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + Headers/OCMStubRecorder.h + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + Headers/OCMock.h + + On/6fINORTxTz9S5hDINgwB7Q+k= + + Headers/OCMockMacros.h + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + Headers/OCMockObject.h + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + Info.plist + + eYsacQNrGmXbyV2m226MyGvCnnc= + + Modules/module.modulemap + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + + files2 + + Headers/NSNotificationCenter+OCMAdditions.h + + hash + + vONiqh5sL6dS88Kx8JYNEZSgZs0= + + hash2 + + OpqlLXl1TYpgdESPdjTcl8ukOnx3PIF/CW2vaf8Hffg= + + + Headers/OCMArg.h + + hash + + 2TtJQtEo2sCB6zXIpOR5CpHd6ZI= + + hash2 + + KlkzlNlKwrlSANkeM5T8f5FOJdV/6ehZzv7wvyec5KA= + + + Headers/OCMConstraint.h + + hash + + Xas8pGuJGxTT/F4ey/TyYW8RdsE= + + hash2 + + 2U5VzXM/137kdDaimPrTw7LgWDfexU81LodocYo6kc0= + + + Headers/OCMFunctions.h + + hash + + 8vgivFuntcZU8V6MIPS/qI7+76c= + + hash2 + + RkAZXLHoOdzRAcb5Xj1jfbb4HG46uX2ebbvAQuL02tE= + + + Headers/OCMLocation.h + + hash + + /0CRbUvWS/08eIbkc7Qs0rVCIpc= + + hash2 + + ccpsG99Nw50eW0nZvLv/IozvOnpFCvXqTcFMQkNv1bU= + + + Headers/OCMMacroState.h + + hash + + eG9h5aC1sciDnimn2qd8D3Whgs8= + + hash2 + + CvW82Uxav33uzaXGAxUzM2ue5TYOB7xRmnoIZ/X/xgs= + + + Headers/OCMQuantifier.h + + hash + + Iz/nUSovlPskrKgJYN3wtrzsQwI= + + hash2 + + AR64qzDpATQzBQbotenP205lhYh7IEtfrdb2tfkjvOk= + + + Headers/OCMRecorder.h + + hash + + Nuc9k8M2llCQS3ElBXYmXmOgYSA= + + hash2 + + 2yDq8ywLd4CnfinJmX1elhIUKtQRYv+bJDX5p+KPATo= + + + Headers/OCMStubRecorder.h + + hash + + UlinOlGX+5BrG/p3FpLJyfKrfBc= + + hash2 + + YJjzSF6DMhEmPqm7LnSnWdiCqSwsepMeGN4i1SKoHz4= + + + Headers/OCMock.h + + hash + + On/6fINORTxTz9S5hDINgwB7Q+k= + + hash2 + + Vt6bfx1xsYy28YCOPDtY7NzbG6grfcluwOF5MZqjyd4= + + + Headers/OCMockMacros.h + + hash + + I/Um7WTr4ycb9SAiuXqMQqZr56s= + + hash2 + + p45nXBg6Fyw2+Orzsv08dNq/tVPRv8ccEh8pkl2T/nk= + + + Headers/OCMockObject.h + + hash + + gs1jfQy3OVzcDFaoOf3h85dDCHg= + + hash2 + + SWo2XBfpB3ZcUgcIZvzTYDXcjmquNSdDpEXNe0U1zeo= + + + Modules/module.modulemap + + hash + + D8QZr5r+V+F/EzuAFJHCo218QzY= + + hash2 + + pJYkV/qB275HCglrXGI/POf3dh+jBQ7qNq2ZpQojitk= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..b415604 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,48 @@ +codecov: + # Require CI to pass to show coverage, default yes + require_ci_to_pass: yes + notify: + # Codecov should wait for all CI statuses to complete, default yes + wait_for_ci: yes + +coverage: + # Coverage precision range 0-5, default 2 + precision: 2 + + # Direction to round the coverage value - up, down, nearest, default down + round: nearest + + # Value range for red...green, default 70...100 + range: "70...90" + + status: + # Overall project coverage, compare against pull request base + project: + default: + # The required coverage value + target: 50% + + # The leniency in hitting the target. Allow coverage to drop by X% + threshold: 5% + + # Only measure lines adjusted in the pull request or single commit, if the commit in not in the pr + patch: + default: + # The required coverage value + target: 85% + + # Allow coverage to drop by X% + threshold: 5% + changes: no + +comment: + # Pull request Codecov comment format. + # diff: coverage diff of the pull request + # files: a list of files impacted by the pull request (coverage changes, file is new or removed) + layout: "diff, files" + + # Update Codecov comment, if exists. Otherwise post new + behavior: default + + # If true, only post the Codecov comment if coverage changes + require_changes: false \ No newline at end of file diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..abdac63 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,12 @@ +#!/bin/bash + +git diff --diff-filter=d --staged --name-only | grep -e '\.\(h\|m\)' | while read line; do + if [[ $line == *"/Generated"* ]]; then + echo "IGNORING GENERATED FILE: " "$line"; + else + clang-format -style=file -i "${line}"; + git add "$line"; + fi +done + +xcodegen \ No newline at end of file diff --git a/project.yml b/project.yml new file mode 100644 index 0000000..487ecbe --- /dev/null +++ b/project.yml @@ -0,0 +1,60 @@ +name: CaptureKit +options: + developmentLanguage: en + createIntermediateGroups: true + deploymentTarget: + macOS: 11.0 + xcodeVersion: 14.0 +settings: + base: + SWIFT_VERSION: "5.7" + PRODUCT_BUNDLE_IDENTIFIER: com.nikitavasilev.capture-kit + CODE_SIGN_STYLE: automatic + GENERATE_INFOPLIST_FILE: YES +attributes: + ORGANIZATIONNAME: space-code +schemes: + CaptureKit: + build: + targets: + CaptureKit: all + run: + config: Debug + test: + gatherCoverageData: true + targets: + - CaptureKitTests + coverageTargets: + - CaptureKit +targets: + CaptureKit: + type: framework + platform: macOS + sources: + - path: CaptureKit + settings: + base: + MARKETING_VERSION: 1.0.0 + CURRENT_PROJECT_VERSION: 1 + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER: NO + CaptureKitTests: + type: bundle.unit-test + platform: macOS + sources: + - CaptureKitTests + dependencies: + - target: CaptureKit + - framework: ThirdParty/OCMock.xcframework + settings: + base: + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER: NO +aggregateTargets: + OCLint: + buildScripts: + - script: | + cd ${SRCROOT} + xcodebuild clean + xcodebuild -project CaptureKit.xcodeproj COMPILER_INDEX_STORE_ENABLE=NO | xcpretty -r json-compilation-database --output compile_commands.json + oclint-json-compilation-database -e build -- -report-type xcode + name: OCLint +