Add a performance test for the Diamond-Square renderer

This commit is contained in:
Eryn Wells 2018-11-11 22:11:15 -05:00
parent f0d6177567
commit 50d895afa1
3 changed files with 65 additions and 0 deletions

View file

@ -13,6 +13,16 @@ fileprivate typealias Box = DiamondSquareGenerator.Box
fileprivate typealias Point = DiamondSquareGenerator.Point
fileprivate typealias Size = DiamondSquareGenerator.Size
class DiamondSquareAlgorithmPerformanceTests: XCTestCase {
func testAlgorithmOn129() {
let box = Box(origin: Point(x: 0, y: 0), size: Size(w: 129, h: 129))
let alg = DiamondSquareGenerator.Algorithm(grid: box)
measure {
_ = alg.queue_render()
}
}
}
class DiamondSquareAlgorithmTests: XCTestCase {
fileprivate let grid = Box(origin: Point(x: 0, y: 0), size: Size(w: 5, h: 5))