@@ -19,7 +19,7 @@ import Testing
1919struct JNIModuleTests {
2020 let globalMethodWithPrimitives = """
2121 public func helloWorld()
22- public func takeIntegers(i1: Int8, i2: Int16, i3: Int32, i4: Int ) -> UInt16
22+ public func takeIntegers(i1: Int8, i2: Int16, i3: Int32, i4: Int64 ) -> UInt16
2323 public func otherPrimitives(b: Bool, f: Float, d: Double)
2424 """
2525
@@ -73,7 +73,7 @@ struct JNIModuleTests {
7373 /**
7474 * Downcall to Swift:
7575 * {@snippet lang=swift :
76- * public func takeIntegers(i1: Int8, i2: Int16, i3: Int32, i4: Int ) -> UInt16
76+ * public func takeIntegers(i1: Int8, i2: Int16, i3: Int32, i4: Int64 ) -> UInt16
7777 * }
7878 */
7979 public static native char takeIntegers(byte i1, short i2, int i3, long i4);
@@ -100,21 +100,21 @@ struct JNIModuleTests {
100100 detectChunkByInitialLines: 1 ,
101101 expectedChunks: [
102102 """
103- @_cdecl( " Java_com_example_swift_SwiftModule_helloWorld " )
104- func swiftjava_SwiftModule_helloWorld (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) {
103+ @_cdecl( " Java_com_example_swift_SwiftModule_helloWorld__ " )
104+ func Java_com_example_swift_SwiftModule_helloWorld__ (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) {
105105 SwiftModule.helloWorld()
106106 }
107107 """ ,
108108 """
109- @_cdecl( " Java_com_example_swift_SwiftModule_takeIntegers " )
110- func swiftjava_SwiftModule_takeIntegers_i1_i2_i3_i4 (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, i1: jbyte, i2: jshort, i3: jint, i4: jlong) -> jchar {
111- let result = SwiftModule.takeIntegers(i1: Int8(fromJNI: i1, in: environment!), i2: Int16(fromJNI: i2, in: environment!), i3: Int32(fromJNI: i3, in: environment!), i4: Int (fromJNI: i4, in: environment!))
109+ @_cdecl( " Java_com_example_swift_SwiftModule_takeIntegers__BSIJ " )
110+ func Java_com_example_swift_SwiftModule_takeIntegers__BSIJ (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, i1: jbyte, i2: jshort, i3: jint, i4: jlong) -> jchar {
111+ let result = SwiftModule.takeIntegers(i1: Int8(fromJNI: i1, in: environment!), i2: Int16(fromJNI: i2, in: environment!), i3: Int32(fromJNI: i3, in: environment!), i4: Int64 (fromJNI: i4, in: environment!))
112112 return result.getJNIValue(in: environment)
113113 }
114114 """ ,
115115 """
116- @_cdecl( " Java_com_example_swift_SwiftModule_otherPrimitives " )
117- func swiftjava_SwiftModule_otherPrimitives_b_f_d (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, b: jboolean, f: jfloat, d: jdouble) {
116+ @_cdecl( " Java_com_example_swift_SwiftModule_otherPrimitives__ZFD " )
117+ func Java_com_example_swift_SwiftModule_otherPrimitives__ZFD (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, b: jboolean, f: jfloat, d: jdouble) {
118118 SwiftModule.otherPrimitives(b: Bool(fromJNI: b, in: environment!), f: Float(fromJNI: f, in: environment!), d: Double(fromJNI: d, in: environment!))
119119 }
120120 """
@@ -151,8 +151,8 @@ struct JNIModuleTests {
151151 detectChunkByInitialLines: 1 ,
152152 expectedChunks: [
153153 """
154- @_cdecl( " Java_com_example_swift_SwiftModule_copy " )
155- func swiftjava_SwiftModule_copy__ (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, string: jstring?) -> jstring? {
154+ @_cdecl( " Java_com_example_swift_SwiftModule_copy__Ljava_lang_String_2 " )
155+ func Java_com_example_swift_SwiftModule_copy__Ljava_lang_String_2 (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, string: jstring?) -> jstring? {
156156 let result = SwiftModule.copy(String(fromJNI: string, in: environment!))
157157 return result.getJNIValue(in: environment)
158158 }
@@ -199,8 +199,8 @@ struct JNIModuleTests {
199199 detectChunkByInitialLines: 1 ,
200200 expectedChunks: [
201201 """
202- @_cdecl( " Java_com_example_swift_SwiftModule_methodA " )
203- func swiftjava_SwiftModule_methodA (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) {
202+ @_cdecl( " Java_com_example_swift_SwiftModule_methodA__ " )
203+ func Java_com_example_swift_SwiftModule_methodA__ (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) {
204204 do {
205205 try SwiftModule.methodA()
206206 } catch {
@@ -209,8 +209,8 @@ struct JNIModuleTests {
209209 }
210210 """ ,
211211 """
212- @_cdecl( " Java_com_example_swift_SwiftModule_methodB " )
213- func swiftjava_SwiftModule_methodB (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) -> jlong {
212+ @_cdecl( " Java_com_example_swift_SwiftModule_methodB__ " )
213+ func Java_com_example_swift_SwiftModule_methodB__ (environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) -> jlong {
214214 do {
215215 let result = try SwiftModule.methodB()
216216 return result.getJNIValue(in: environment)
0 commit comments