Remove unit test for the old Swift controller class

This commit is contained in:
Cameron Gutman
2019-08-07 00:03:58 -07:00
parent c08df921da
commit 311e77e01a
4 changed files with 0 additions and 362 deletions

View File

@@ -22,7 +22,6 @@
98CFB82F1CAD481B0048EF74 /* libmoonlight-common.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 98AB2E841CAD46840089BB98 /* libmoonlight-common.a */; };
98D5856D1C0EA79600F6CC00 /* TemporaryHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 98D5856C1C0EA79600F6CC00 /* TemporaryHost.m */; };
98D585701C0ED0E800F6CC00 /* TemporarySettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 98D5856F1C0ED0E800F6CC00 /* TemporarySettings.m */; };
D46A73AD1CBC7D090039F1EE /* ControllerUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46A73AC1CBC7D090039F1EE /* ControllerUnitTests.swift */; };
DC1F5A07206436B20037755F /* ConnectionHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = DC1F5A06206436B20037755F /* ConnectionHelper.m */; };
FB1A674D2131E65900507771 /* KeyboardSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = FB1A674C2131E65900507771 /* KeyboardSupport.m */; };
FB1A67602132419700507771 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB1A675E2132419700507771 /* Main.storyboard */; };
@@ -137,13 +136,6 @@
remoteGlobalIDString = FB290E2D19B37A4E004C83CF;
remoteInfo = "moonlight-common";
};
D46A73A51CBC7CB60039F1EE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FB290CE619B2C406004C83CF /* Project object */;
proxyType = 1;
remoteGlobalIDString = FB290CED19B2C406004C83CF;
remoteInfo = Moonlight;
};
FB1A68142132509400507771 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 98AB2E7F1CAD46830089BB98 /* moonlight-common.xcodeproj */;
@@ -178,10 +170,6 @@
98D5856C1C0EA79600F6CC00 /* TemporaryHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TemporaryHost.m; path = Database/TemporaryHost.m; sourceTree = "<group>"; };
98D5856E1C0ED0E800F6CC00 /* TemporarySettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TemporarySettings.h; path = Database/TemporarySettings.h; sourceTree = "<group>"; };
98D5856F1C0ED0E800F6CC00 /* TemporarySettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TemporarySettings.m; path = Database/TemporarySettings.m; sourceTree = "<group>"; };
D46A73A01CBC7CB60039F1EE /* MoonlightUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MoonlightUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D46A73A41CBC7CB60039F1EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D46A73AB1CBC7D080039F1EE /* MoonlightUnitTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MoonlightUnitTests-Bridging-Header.h"; sourceTree = "<group>"; };
D46A73AC1CBC7D090039F1EE /* ControllerUnitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ControllerUnitTests.swift; path = Input/ControllerUnitTests.swift; sourceTree = "<group>"; };
D4746EEA1CBC740C006FB401 /* Moonlight-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Moonlight-Bridging-Header.h"; path = "Input/Moonlight-Bridging-Header.h"; sourceTree = "<group>"; };
DC1F5A05206436B10037755F /* ConnectionHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConnectionHelper.h; sourceTree = "<group>"; };
DC1F5A06206436B20037755F /* ConnectionHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConnectionHelper.m; sourceTree = "<group>"; };
@@ -370,13 +358,6 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D46A739D1CBC7CB60039F1EE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB1A67502132419700507771 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -420,24 +401,6 @@
name = Products;
sourceTree = "<group>";
};
D46A73A11CBC7CB60039F1EE /* MoonlightUnitTests */ = {
isa = PBXGroup;
children = (
D46A73AB1CBC7D080039F1EE /* MoonlightUnitTests-Bridging-Header.h */,
D46A73AA1CBC7CEF0039F1EE /* Input */,
D46A73A41CBC7CB60039F1EE /* Info.plist */,
);
path = MoonlightUnitTests;
sourceTree = "<group>";
};
D46A73AA1CBC7CEF0039F1EE /* Input */ = {
isa = PBXGroup;
children = (
D46A73AC1CBC7D090039F1EE /* ControllerUnitTests.swift */,
);
name = Input;
sourceTree = "<group>";
};
FB1A67542132419700507771 /* Moonlight TV */ = {
isa = PBXGroup;
children = (
@@ -455,7 +418,6 @@
children = (
98AB2E7F1CAD46830089BB98 /* moonlight-common.xcodeproj */,
FB290CF919B2C406004C83CF /* Moonlight */,
D46A73A11CBC7CB60039F1EE /* MoonlightUnitTests */,
FB1A67542132419700507771 /* Moonlight TV */,
FB290CF019B2C406004C83CF /* Frameworks */,
FB290CEF19B2C406004C83CF /* Products */,
@@ -466,7 +428,6 @@
isa = PBXGroup;
children = (
FB290CEE19B2C406004C83CF /* Moonlight.app */,
D46A73A01CBC7CB60039F1EE /* MoonlightUnitTests.xctest */,
FB1A67532132419700507771 /* Moonlight TV.app */,
);
name = Products;
@@ -836,24 +797,6 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D46A739F1CBC7CB60039F1EE /* MoonlightUnitTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = D46A73A91CBC7CB60039F1EE /* Build configuration list for PBXNativeTarget "MoonlightUnitTests" */;
buildPhases = (
D46A739C1CBC7CB60039F1EE /* Sources */,
D46A739D1CBC7CB60039F1EE /* Frameworks */,
D46A739E1CBC7CB60039F1EE /* Resources */,
);
buildRules = (
);
dependencies = (
D46A73A61CBC7CB60039F1EE /* PBXTargetDependency */,
);
name = MoonlightUnitTests;
productName = MoonlightUnitTests;
productReference = D46A73A01CBC7CB60039F1EE /* MoonlightUnitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
FB1A67522132419700507771 /* Moonlight TV */ = {
isa = PBXNativeTarget;
buildConfigurationList = FB1A67682132419A00507771 /* Build configuration list for PBXNativeTarget "Moonlight TV" */;
@@ -900,11 +843,6 @@
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "Moonlight Game Streaming Project";
TargetAttributes = {
D46A739F1CBC7CB60039F1EE = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0920;
TestTargetID = FB290CED19B2C406004C83CF;
};
FB1A67522132419700507771 = {
CreatedOnToolsVersion = 9.4.1;
LastSwiftMigration = 1010;
@@ -942,7 +880,6 @@
projectRoot = "";
targets = (
FB290CED19B2C406004C83CF /* Moonlight */,
D46A739F1CBC7CB60039F1EE /* MoonlightUnitTests */,
FB1A67522132419700507771 /* Moonlight TV */,
);
};
@@ -966,13 +903,6 @@
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
D46A739E1CBC7CB60039F1EE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
FB1A67512132419700507771 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -999,14 +929,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
D46A739C1CBC7CB60039F1EE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D46A73AD1CBC7D090039F1EE /* ControllerUnitTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FB1A674F2132419700507771 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1115,11 +1037,6 @@
name = "moonlight-common";
targetProxy = 98AB2E851CAD468B0089BB98 /* PBXContainerItemProxy */;
};
D46A73A61CBC7CB60039F1EE /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = FB290CED19B2C406004C83CF /* Moonlight */;
targetProxy = D46A73A51CBC7CB60039F1EE /* PBXContainerItemProxy */;
};
FB1A68172132509800507771 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "moonlight-common-tv";
@@ -1147,56 +1064,6 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
D46A73A71CBC7CB60039F1EE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = MoonlightUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.moonlight-stream.MoonlightUnitTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "MoonlightUnitTests/MoonlightUnitTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Moonlight.app/Moonlight";
};
name = Debug;
};
D46A73A81CBC7CB60039F1EE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = MoonlightUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.moonlight-stream.MoonlightUnitTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "MoonlightUnitTests/MoonlightUnitTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Moonlight.app/Moonlight";
};
name = Release;
};
FB1A67662132419A00507771 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -1468,15 +1335,6 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D46A73A91CBC7CB60039F1EE /* Build configuration list for PBXNativeTarget "MoonlightUnitTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D46A73A71CBC7CB60039F1EE /* Debug */,
D46A73A81CBC7CB60039F1EE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FB1A67682132419A00507771 /* Build configuration list for PBXNativeTarget "Moonlight TV" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -1,192 +0,0 @@
//
// ControllerUnitTests.swift
// Moonlight
//
// Created by David Aghassi on 4/11/16.
// Copyright © 2016 Moonlight Stream. All rights reserved.
//
import XCTest
@testable import Moonlight
/**
Tests the `Controller.swift` class
*/
class ControllerUnitTests: XCTestCase {
var controllerUnderTest: Controller!
override func setUp() {
controllerUnderTest = Controller()
XCTAssertNotNil(controllerUnderTest, "controllerUnderTest is nil, and should not be for this test. See line \(#line) \n")
}
override func tearDown() {
resetAllValues()
}
// MARK: Helper Methods
/**
Sets all the values of `controllerUnderTest` to `0`
*/
func resetAllValues() {
controllerUnderTest.emulatingButtonFlags = CInt(0)
controllerUnderTest.lastButtonFlags = CInt(0)
controllerUnderTest.lastLeftStickX = CShort(0)
controllerUnderTest.lastLeftStickY = CShort(0)
controllerUnderTest.lastRightStickX = CShort(0)
controllerUnderTest.lastRightStickY = CShort(0)
controllerUnderTest.lastLeftTrigger = CChar(0)
controllerUnderTest.lastRightTrigger = CChar(0)
}
/**
Displays "*name* failed to set CInt correctly." Shows expected and actual, as well as failure line.
- parameter name: The property being tested
- parameter expected: The expected value for the property
- parameter actual: The actual value for the property
- returns: A string with the failure in it. Formatted to state actual, expected, and the failure line.
*/
func displayCIntFailure(name: String, expected: CInt, actual: CInt) -> String {
return "\(name) failed to set CInt correctly \n. Expected: \(expected)\n. Actual: \(actual) \n. See line \(#line) \n"
}
/**
Displays "*name* failed to set CShort correctly." Shows expected and actual, as well as failure line.
- parameter name: The property being tested
- parameter expected: The expected value for the property
- parameter actual: The actual value for the property
- returns: A string with the failure in it. Formatted to state actual, expected, and the failure line.
*/
func displayCShortFailure(name: String, expected: CShort, actual: CShort) -> String {
return "\(name) failed to set CShort correctly \n. Expected: \(expected)\n. Actual: \(actual) \n. See line \(#line) \n"
}
/**
Displays "*name* failed to set CCHar correctly." Shows expected and actual, as well as the failure line.
- parameter name: The property being tested
- parameter expected: The expected value for the property
- parameter actual: The actual value for the property
- returns: A string with the failure in it. Formatted to state actual, expected, and the failure line.
*/
func displayCCharFailure(name: String, expected: CChar, actual: CChar) -> String {
return "\(name) failed to set CChar correctly \n. Expected: \(expected)\n. Actual: \(actual) \n. See line \(#line) \n"
}
// MARK: Tests
/**
Asserts that the `emulatingButtonFlags` is of type `CInt` and can be set and gotten from properly
*/
func test_Assert_emulatingButtonFlags_Sets_To_CInt() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.emulatingButtonFlags) == CInt.self, "Expected emulatingButtonFlags to be of type CInt. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CInt(1)
controllerUnderTest.emulatingButtonFlags = expected
XCTAssertTrue(controllerUnderTest.emulatingButtonFlags == expected, displayCIntFailure(name: "emulatingButtonFlags", expected: expected, actual: controllerUnderTest.emulatingButtonFlags))
}
/**
Asserts that the `lastButtonFlags` is of type `CInt` and can be set and gotten from properly
*/
func test_Assert_lastButtonFlags_Sets_To_CInt() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastButtonFlags) == CInt.self, "Expected lastButtonFlags to be of type CInt. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CInt(1)
controllerUnderTest.lastButtonFlags = expected
XCTAssertTrue(controllerUnderTest.lastButtonFlags == expected, displayCIntFailure(name: "lastButtonFlags", expected: expected, actual: controllerUnderTest.lastButtonFlags))
}
/**
Asserts that the `lastLeftStickX` is of type `CShort` and can be set and gotten from properly
*/
func test_Assert_lastLeftStickX_Sets_To_CShort() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastLeftStickX) == CShort.self, "Expected lastLeftStickX to be of type CShort. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CShort(1)
controllerUnderTest.lastLeftStickX = expected
XCTAssertTrue(controllerUnderTest.lastLeftStickX == expected, displayCShortFailure(name: "lastLeftStickX", expected: expected, actual: controllerUnderTest.lastLeftStickX))
}
/**
Asserts that lastLeftStickY` is of type `CShort` and can be set and gotten from properly
*/
func test_Assert_lastLeftStickY_Sets_To_CShort() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastLeftStickY) == CShort.self, "Expected lastLeftStickY to be of type CShort. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CShort(1)
controllerUnderTest.lastLeftStickY = expected
XCTAssertTrue(controllerUnderTest.lastLeftStickY == expected, displayCShortFailure(name: "lastLeftStickY", expected: expected, actual: controllerUnderTest.lastLeftStickY))
}
/**
Asserts that the `lastRightStickX` is of type `CShort` and can be set and gotten from properly
*/
func test_Assert_lastRightStickX_SetsTo_CShort() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastRightStickX) == CShort.self, "Expected lastRightStickX to be of type CShort. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CShort(1)
controllerUnderTest.lastRightStickX = expected
XCTAssertTrue(controllerUnderTest.lastRightStickX == expected, displayCShortFailure(name: "lastRightStickX", expected: expected, actual: controllerUnderTest.lastRightStickX))
}
/**
Asserts that the `lastRightStickY` is of type `CShort` and can be set and gotten from properly
*/
func test_Assert_lastRightStickY_Sets_To_CShort() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastRightStickY) == CShort.self, "Expected lastRightStickY to be of type CShort. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CShort(1)
controllerUnderTest.lastRightStickY = expected
XCTAssertTrue(controllerUnderTest.lastRightStickY == expected, displayCShortFailure(name: "lastRightStickY", expected: expected, actual: controllerUnderTest.lastRightStickY))
}
/**
Asserts that the `lastLeftTrigger` is of type `CChar` and can be set and gotten from properly
*/
func test_Assert_lastLeftTrigger_Sets_To_CChar() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastLeftTrigger) == CChar.self, "Expected lastLeftTrigger to be of type CChar. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CChar(1)
controllerUnderTest.lastLeftTrigger = expected
XCTAssertTrue(controllerUnderTest.lastLeftTrigger == expected, displayCCharFailure(name: "lastLeftTrigger", expected: expected, actual: controllerUnderTest.lastLeftTrigger))
}
/**
Asserts that the `lastRightTrigger` is of type `CChar` and can be set and gotten from properly
*/
func test_Assert_lastRightTrigger_Sets_To_CChar() {
// Assert type hasn't changed
XCTAssertTrue(type(of: controllerUnderTest.lastRightTrigger) == CChar.self, "Expected lastRightTrigger to be of type CChar. See line \(#line) \n")
// Assert value is assigned properly.
let expected = CChar(1)
controllerUnderTest.lastRightTrigger = expected
XCTAssertTrue(controllerUnderTest.lastRightTrigger == expected, displayCCharFailure(name: "lastRightTrigger", expected: expected, actual: controllerUnderTest.lastRightTrigger))
}
}

View File

@@ -1,4 +0,0 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//