File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,14 @@ public func echoUnsignedInt(i: UInt32, j: UInt64) -> UInt64 {
5252 return UInt64 ( i) + j
5353}
5454
55+ public func returnUnsignedByte( b: UInt8 ) -> UInt8 {
56+ return b
57+ }
58+
59+ public func returnLargestUnsignedByte( ) -> UInt8 {
60+ return UInt8 . max
61+ }
62+
5563// ==== Internal helpers
5664
5765func p( _ msg: String , file: String = #fileID, line: UInt = #line, function: String = #function) {
Original file line number Diff line number Diff line change @@ -68,4 +68,14 @@ void globalUnsignedIntEcho() {
6868 long l = 1200 ;
6969 assertEquals (1212 , MySwiftLibrary .echoUnsignedInt (12 , 1200 ));
7070 }
71+
72+ @ Test
73+ void returnUnsignedByte_negative () {
74+ assertEquals (-50 , MySwiftLibrary .returnUnsignedByte ((byte ) -50 ));
75+ }
76+
77+ @ Test
78+ void returnLargestUnsignedByte () {
79+ assertEquals (-1 , MySwiftLibrary .returnLargestUnsignedByte ());
80+ }
7181}
You can’t perform that action at this time.
0 commit comments