Skip to content

Commit 50eb3aa

Browse files
committed
Updated unit tests
1 parent 6db8eb3 commit 50eb3aa

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

Tests/SDLTests/SDLTests.swift

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
1+
import Foundation
12
import XCTest
23
@testable import SDL
34

45
class SDLTests: XCTestCase {
56

6-
func testExample() {
7-
7+
func testDrivers() {
88

9+
print("Available Render Drivers:")
10+
let renderDrivers = SDLRenderer.Driver.all
11+
XCTAssert(renderDrivers.count > 0)
12+
if renderDrivers.isEmpty == false {
13+
print("=======")
14+
for driver in renderDrivers {
15+
16+
do {
17+
let info = try SDLRenderer.Info(driver: driver)
18+
print("Driver:", driver.rawValue)
19+
print("Name:", info.name)
20+
print("Options:")
21+
info.options.forEach { print(" \($0)") }
22+
print("Formats:")
23+
info.formats.forEach { print(" \($0)") }
24+
if info.maximumSize.width > 0 || info.maximumSize.height > 0 {
25+
print("Maximum Size:")
26+
print(" Width: \(info.maximumSize.width)")
27+
print(" Height: \(info.maximumSize.height)")
28+
}
29+
print("=======")
30+
} catch {
31+
print("Could not get information for driver \(driver.rawValue)")
32+
}
33+
}
34+
}
935
}
1036
}

0 commit comments

Comments
 (0)