From 8020ae82f52490591980f130346846ea8cb2dbf3 Mon Sep 17 00:00:00 2001 From: Peter Hanspers Date: Tue, 9 Jan 2018 14:26:41 +0100 Subject: [PATCH] Adding test to check for c++ in framework headers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8469 Change-Id: I336a2aa75638920901c2bddf07fb03cb00ccb83e Reviewed-on: https://webrtc-review.googlesource.com/38020 Commit-Queue: Peter Hanspers Reviewed-by: Kári Helgason Reviewed-by: Anders Carlsson Cr-Commit-Position: refs/heads/master@{#21536} --- sdk/BUILD.gn | 1 + ...NotPutCPlusPlusInFrameworkHeaders_xctest.m | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 sdk/objc/Framework/UnitTests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index 655c79f67e..14d529a4dc 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -542,6 +542,7 @@ if (is_ios || is_mac) { ] sources = [ + "objc/Framework/UnitTests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m", "objc/Framework/UnitTests/RTCFileVideoCapturer_xctest.mm", ] diff --git a/sdk/objc/Framework/UnitTests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m b/sdk/objc/Framework/UnitTests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m new file mode 100644 index 0000000000..02bef9bfb7 --- /dev/null +++ b/sdk/objc/Framework/UnitTests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m @@ -0,0 +1,30 @@ +/* + * Copyright 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#import + +#import + +#import + +@interface RTCDoNotPutCPlusPlusInFrameworkHeaders : XCTestCase +@end + +@implementation RTCDoNotPutCPlusPlusInFrameworkHeaders + +- (void)testNoCPlusPlusInFrameworkHeaders { + NSString *fullPath = [NSString stringWithFormat:@"%s", __FILE__]; + NSString *extension = fullPath.pathExtension; + + XCTAssertEqualObjects( + @"m", extension, @"Do not rename %@. It should end with .m.", fullPath.lastPathComponent); +} + +@end