Skip to content

Commit 55e1f83

Browse files
committed
Updated version and tests
1 parent 4e1c4c5 commit 55e1f83

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

Sources/Thrift.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class Thrift {
2-
let version = "0.0.1"
2+
let version = "1.1.0"
33
}

Tests/ThriftTests/TBinaryProtocolTests.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,28 @@ class TBinaryProtocolTests: XCTestCase {
129129
XCTAssertFalse(true, "Caught Error attempting to read \(error)")
130130
}
131131
}
132+
func testUnsafeBitcastUpdate() {
133+
let value: Double = 3.14159
134+
let val: Int64 = 31415926
135+
let uval: UInt64 = 31415926
136+
137+
let i64 = Int64(bitPattern: value.bitPattern)
138+
let ubc = unsafeBitCast(value, to: Int64.self)
139+
140+
XCTAssertEqual(i64, ubc, "Bitcast Double-> i64 Values don't match")
141+
142+
let dbl = Double(bitPattern: UInt64(val))
143+
let ubdb = unsafeBitCast(val, to: Double.self)
144+
145+
XCTAssertEqual(dbl, ubdb, "Bitcast i64 -> Double Values don't match")
146+
147+
let db2 = Double(bitPattern: uval)
148+
let usbc2 = unsafeBitCast(uval, to: Double.self)
149+
150+
XCTAssertEqual(db2, usbc2, "Bitcast u64 -> Double Values don't match")
151+
152+
153+
}
132154

133155
static var allTests : [(String, (TBinaryProtocolTests) -> () throws -> Void)] {
134156
return [

Tests/ThriftTests/ThriftTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import XCTest
33

44
class ThriftTests: XCTestCase {
55
func testVersion() {
6-
XCTAssertEqual(Thrift().version, "1.0.0")
6+
XCTAssertEqual(Thrift().version, "1.1.0")
77
}
88

99
func test_in_addr_extension() {

0 commit comments

Comments
 (0)