2018-08-23 08:19:25 +00:00
|
|
|
//
|
|
|
|
// RandomTests.swift
|
2018-08-23 10:07:55 +00:00
|
|
|
// TunnelKitTests
|
2018-08-23 08:19:25 +00:00
|
|
|
//
|
|
|
|
// Created by Davide De Rosa on 07/07/2018.
|
|
|
|
// Copyright © 2018 London Trust Media. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
2018-08-23 10:09:44 +00:00
|
|
|
@testable import TunnelKit
|
2018-08-23 08:19:25 +00:00
|
|
|
|
|
|
|
class RandomTests: XCTestCase {
|
|
|
|
|
|
|
|
override func 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.
|
|
|
|
}
|
|
|
|
|
|
|
|
func testRandom1() {
|
|
|
|
print(try! SecureRandom.uint32())
|
|
|
|
print(try! SecureRandom.uint32())
|
|
|
|
print(try! SecureRandom.uint32())
|
|
|
|
print(try! SecureRandom.uint32())
|
|
|
|
print(try! SecureRandom.uint32())
|
|
|
|
}
|
|
|
|
|
|
|
|
func testRandom2() {
|
|
|
|
print("random UInt32: \(try! SecureRandom.uint32())")
|
|
|
|
print("random bytes: \(try! SecureRandom.data(length: 12).toHex())")
|
|
|
|
}
|
|
|
|
}
|