Commit ca81ecdd authored by Mike JS. Choi's avatar Mike JS. Choi Committed by Carola Nitz

Tests: Add XCTAssertNotNilAndUnwrap

parent d5d375e3
......@@ -179,6 +179,8 @@
8D826AE1203F3CC500536EF7 /* VLCRendererDiscoverer.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 8D2CE647203DCC48004BB7F6 /* VLCRendererDiscoverer.h */; };
8D826AE2203F3CC500536EF7 /* VLCRendererItem.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 8D2CE64E203EEA47004BB7F6 /* VLCRendererItem.h */; };
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
CA7BC89120F4419E00C86820 /* XCTestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA7BC88720F4418000C86820 /* XCTestHelper.swift */; };
CA7BC89520F441B500C86820 /* XCTestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA7BC88720F4418000C86820 /* XCTestHelper.swift */; };
CAA03D0C20C8DCDB001764DA /* libTVVLCKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D1329591BA304D900BE647E /* libTVVLCKit.a */; };
CAA03D1720C8DE4D001764DA /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CAA03D1620C8DE4D001764DA /* libbz2.tbd */; };
CAA03D1920C8DE51001764DA /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CAA03D1820C8DE51001764DA /* libz.tbd */; };
......@@ -422,6 +424,7 @@
CA0301CB20ADFD2500452BB8 /* MobileVLCKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MobileVLCKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CA0301CF20ADFD2500452BB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CA08590420F7184A00B3AB69 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = Headers/Internal/macros.h; sourceTree = "<group>"; };
CA7BC88720F4418000C86820 /* XCTestHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTestHelper.swift; sourceTree = "<group>"; };
CA978D1E20B89F4B00F7E768 /* MobileVLCKitTests-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MobileVLCKitTests-Bridging-Header.h"; sourceTree = "<group>"; };
CAA03D0720C8DCDA001764DA /* TVVLCKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TVVLCKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
CAA03D1620C8DE4D001764DA /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS11.4.sdk/usr/lib/libbz2.tbd; sourceTree = DEVELOPER_DIR; };
......@@ -786,9 +789,18 @@
path = MobileVLCKitTests;
sourceTree = "<group>";
};
CA7BC88520F4418000C86820 /* Helper */ = {
isa = PBXGroup;
children = (
CA7BC88720F4418000C86820 /* XCTestHelper.swift */,
);
path = Helper;
sourceTree = "<group>";
};
CAA9EFFC20D2546000CDBB2C /* Tests */ = {
isa = PBXGroup;
children = (
CA7BC88520F4418000C86820 /* Helper */,
CAA9F00020D254A600CDBB2C /* Sources */,
CAA9EFFD20D2549300CDBB2C /* TVVLCKitTests */,
CA0301CC20ADFD2500452BB8 /* MobileVLCKitTests */,
......@@ -1171,6 +1183,7 @@
buildActionMask = 2147483647;
files = (
CABF4D4120D8DBA900FCCE29 /* VLCMediaTest.swift in Sources */,
CA7BC89120F4419E00C86820 /* XCTestHelper.swift in Sources */,
CAA9F00320D254AB00CDBB2C /* VLCTimeTest.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -1180,6 +1193,7 @@
buildActionMask = 2147483647;
files = (
CABF4D4220D8DBA900FCCE29 /* VLCMediaTest.swift in Sources */,
CA7BC89520F441B500C86820 /* XCTestHelper.swift in Sources */,
CAA9F00420D254AC00CDBB2C /* VLCTimeTest.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
/*****************************************************************************
* XCTestHelper.swift
*****************************************************************************
* Copyright (C) 2018 Mike JS. Choi
* Copyright (C) 2018 VLC authors and VideoLAN
* $Id$
*
* Authors: Mike JS. Choi <mkchoi212 # icloud.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import XCTest
struct UnexpectedNilError: Error {}
func XCTAssertNotNilAndUnwrap<T>(_ variable: T?, message: String = "Unexpected nil variable", file: StaticString = #file, line: UInt = #line) throws -> T {
guard let variable = variable else {
XCTFail(message, file: file, line: line)
throw UnexpectedNilError()
}
return variable
}
let STANDARD_TIME_OUT = 5.0
......@@ -87,6 +87,7 @@
7DEBDAD9203C561D000A7D2F /* vlc.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CCEC5B7E114D9BE800D34AAB /* vlc.h */; };
CA23EBC120BDF02700C0D635 /* VLCKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DC28D7F20194117002D05C4 /* VLCKit.framework */; };
CA23EBCC20BDF07700C0D635 /* VLCTimeTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA23EBCB20BDF07700C0D635 /* VLCTimeTest.swift */; };
CA7BC8B720F4424100C86820 /* XCTestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA7BC8B020F4424100C86820 /* XCTestHelper.swift */; };
CABF4D5420D8E31700FCCE29 /* VLCMediaTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CABF4D5320D8E31700FCCE29 /* VLCMediaTest.swift */; };
/* End PBXBuildFile section */
......@@ -191,6 +192,7 @@
CA23EBC020BDF02700C0D635 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CA23EBCA20BDF07700C0D635 /* VLCKitTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VLCKitTests-Bridging-Header.h"; sourceTree = "<group>"; };
CA23EBCB20BDF07700C0D635 /* VLCTimeTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VLCTimeTest.swift; sourceTree = "<group>"; };
CA7BC8B020F4424100C86820 /* XCTestHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCTestHelper.swift; sourceTree = "<group>"; };
CABF4D5320D8E31700FCCE29 /* VLCMediaTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VLCMediaTest.swift; sourceTree = "<group>"; };
CCEC5B73114D9BE800D34AAB /* deprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = deprecated.h; path = libvlc/vlc/include/vlc/deprecated.h; sourceTree = SOURCE_ROOT; };
CCEC5B74114D9BE800D34AAB /* libvlc_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = libvlc_events.h; path = libvlc/vlc/include/vlc/libvlc_events.h; sourceTree = SOURCE_ROOT; };
......@@ -435,6 +437,7 @@
CA0B184920BDEFB0001CA52B /* Tests */ = {
isa = PBXGroup;
children = (
CA7BC8AE20F4424100C86820 /* Helper */,
CA23EBC720BDF03400C0D635 /* Sources */,
CA23EBBD20BDF02700C0D635 /* VLCKitTests */,
);
......@@ -459,6 +462,14 @@
path = Sources;
sourceTree = "<group>";
};
CA7BC8AE20F4424100C86820 /* Helper */ = {
isa = PBXGroup;
children = (
CA7BC8B020F4424100C86820 /* XCTestHelper.swift */,
);
path = Helper;
sourceTree = "<group>";
};
CCEC5B6C114D9BD300D34AAB /* libvlc */ = {
isa = PBXGroup;
children = (
......@@ -717,6 +728,7 @@
files = (
CABF4D5420D8E31700FCCE29 /* VLCMediaTest.swift in Sources */,
CA23EBCC20BDF07700C0D635 /* VLCTimeTest.swift in Sources */,
CA7BC8B720F4424100C86820 /* XCTestHelper.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment