diff --git a/Sources/FirebladeECS/Utils.swift b/Sources/FirebladeECS/Utils.swift deleted file mode 100644 index 2f00f40..0000000 --- a/Sources/FirebladeECS/Utils.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Utils.swift -// FirebladeECS -// -// Created by Christian Treffs on 09.10.17. -// - -#if os(macOS) || os(iOS) || os(tvOS) - import CoreFoundation -#endif - -#if os(macOS) || os(iOS) || os(tvOS) - - func retainCount(_ ref: T?) -> Int { - let retainCount: CFIndex = CFGetRetainCount(ref) - return retainCount - } - -#else - func retainCount(_ ref: T?) -> Int { return -1 } - -#endif diff --git a/Tests/FirebladeECSTests/Base.swift b/Tests/FirebladeECSTests/Base.swift index 7f68d50..94a4990 100644 --- a/Tests/FirebladeECSTests/Base.swift +++ b/Tests/FirebladeECSTests/Base.swift @@ -33,5 +33,8 @@ class Velocity: Component { } class Party: Component { - + var partying: Bool + init(partying: Bool) { + self.partying = partying + } } diff --git a/Tests/FirebladeECSTests/ComponentTests.swift b/Tests/FirebladeECSTests/ComponentTests.swift new file mode 100644 index 0000000..fd01945 --- /dev/null +++ b/Tests/FirebladeECSTests/ComponentTests.swift @@ -0,0 +1,33 @@ +// +// ComponentTests.swift +// FirebladeECSTests +// +// Created by Christian Treffs on 21.10.17. +// + +import XCTest +@testable import FirebladeECS + +class ComponentTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testComponentIdentifier() { + let p1 = Position(x: 1, y: 2) + XCTAssert(p1.identifier == Position.identifier) + + let v1 = Velocity(a: 3.14) + XCTAssert(v1.identifier == Velocity.identifier) + XCTAssert(v1.identifier != p1.identifier) + XCTAssert(Velocity.identifier != Position.identifier) + } + +} diff --git a/Tests/FirebladeECSTests/EntityComponentTests.swift b/Tests/FirebladeECSTests/EntityComponentTests.swift deleted file mode 100644 index a5021f7..0000000 --- a/Tests/FirebladeECSTests/EntityComponentTests.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// EntityComponentTests.swift -// FirebladeECS -// -// Created by Christian Treffs on 13.10.17. -// - -import XCTest -/*@testable */import FirebladeECS - -class EntityComponentTests: XCTestCase { - - func testComponentAccess() { - - } -} diff --git a/Tests/FirebladeECSTests/NexusTests.swift b/Tests/FirebladeECSTests/NexusTests.swift index 1664b01..e696cb7 100644 --- a/Tests/FirebladeECSTests/NexusTests.swift +++ b/Tests/FirebladeECSTests/NexusTests.swift @@ -37,10 +37,12 @@ class NexusTests: XCTestCase { XCTAssert(nexus.count == 0) let e0 = nexus.create() + XCTAssert(e0.identifier.index == 0) XCTAssert(nexus.isValid(entity: e0)) XCTAssert(nexus.count == 1) let e1 = nexus.create(entity: "Named e1") + XCTAssert(e1.identifier.index == 1) XCTAssert(nexus.isValid(entity: e1)) XCTAssert(nexus.count == 2) diff --git a/Tests/FirebladeECSTests/PerformanceTests.swift b/Tests/FirebladeECSTests/PerformanceTests.swift deleted file mode 100644 index c1eb256..0000000 --- a/Tests/FirebladeECSTests/PerformanceTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// PerformanceTests.swift -// FirebladeECS -// -// Created by Christian Treffs on 09.10.17. -// - -import XCTest -@testable import FirebladeECS - -class PerformanceTests: XCTestCase { - -} diff --git a/Tests/FirebladeECSTests/SystemTests.swift b/Tests/FirebladeECSTests/SystemTests.swift deleted file mode 100644 index e813434..0000000 --- a/Tests/FirebladeECSTests/SystemTests.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// SystemTests.swift -// FirebladeECS -// -// Created by Christian Treffs on 11.10.17. -// - -import XCTest -import FirebladeECS - -class SystemTests: XCTestCase { - -}