Summary: This diff runs CLANGFORMAT lint on FlipperKitTestUtils. I have added CLANGFORMAT as the lint engined for objc files in xplat/sonar. Right now the iOS folder is not formatted according to CLANGFORMAT. Ran `arc lint -a --paths-cmd "find ./iOS/FlipperKitTests -type f" --verbose` Reviewed By: passy Differential Revision: D19942172 fbshipit-source-id: 58322ef6a3a93f9666b3114e872a3a81a3c1cb35
46 lines
1.0 KiB
Plaintext
46 lines
1.0 KiB
Plaintext
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <XCTest/XCTest.h>
|
|
|
|
#if FB_SONARKIT_ENABLED
|
|
|
|
#import <FlipperKit/CppBridge/FlipperCppWrapperPlugin.h>
|
|
#import <FlipperKit/FlipperPlugin.h>
|
|
|
|
using facebook::flipper::FlipperCppWrapperPlugin;
|
|
|
|
@interface DummyPlugin : NSObject<FlipperPlugin>
|
|
@end
|
|
|
|
@implementation DummyPlugin
|
|
- (NSString*)identifier {
|
|
return @"Dummy";
|
|
}
|
|
- (void)didConnect:(id<FlipperConnection>)connection {
|
|
}
|
|
- (void)didDisconnect {
|
|
}
|
|
@end
|
|
|
|
@interface FlipperCppBridgingTests : XCTestCase
|
|
@end
|
|
|
|
@implementation FlipperCppBridgingTests
|
|
|
|
- (void)testCppWrapperRetainsObjCPlugin {
|
|
NSObject<FlipperPlugin>* dummyPlugin = [DummyPlugin new];
|
|
auto retainCountBefore = CFGetRetainCount((void*)dummyPlugin);
|
|
FlipperCppWrapperPlugin wrapperPlugin(dummyPlugin);
|
|
auto retainCountAfter = CFGetRetainCount((void*)dummyPlugin);
|
|
XCTAssertTrue(retainCountAfter > retainCountBefore);
|
|
}
|
|
|
|
@end
|
|
|
|
#endif
|