You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the Travis Trusty images were changed on 21/06/17, lc-run
segfaults on them when binding to foreign java handlers.
Stop running these tests until we can figure out the issue. The
bug itself is reported as 19934.
foreign handler JavaLocaleDisplayName(in pLocale as JObject) returns JObject binds to "java:java.util.Locale>getDisplayName()Ljava/lang/String;"
153
204
154
205
public handler TestDefaultLocaleDisplayName()
206
+
if not the operating system is in ["mac", "linux"] then
207
+
skip test "get locale display name" because "not implemented on" && the operating system
208
+
return
209
+
end if
210
+
211
+
if the operating system is "linux" then
212
+
skip test "get locale display name" because "bug 19934"
213
+
return
214
+
end if
215
+
155
216
variable tDisplay as JString
156
217
unsafe
157
218
variable tLocale as JObject
@@ -166,6 +227,16 @@ end handler
166
227
foreign handler CreateJavaCurrencyWithCode(in pString as JString) returns JObject binds to "java:java.util.Currency>getInstance(Ljava/lang/String;)Ljava/util/Currency;!static"
167
228
168
229
public handler TestCreateCurrencyWithCode()
230
+
if not the operating system is in ["mac", "linux"] then
231
+
skip test "currency created" because "not implemented on" && the operating system
232
+
return
233
+
end if
234
+
235
+
if the operating system is "linux" then
236
+
skip test "currency created" because "bug 19934"
237
+
return
238
+
end if
239
+
169
240
-- Create a new Currency object
170
241
variable tCurrency as JObject
171
242
unsafe
@@ -206,6 +277,16 @@ public handler NullIntoJObject()
206
277
end handler
207
278
208
279
public handler TestNullJObjectReturn()
280
+
if not the operating system is in ["mac", "linux"] then
281
+
skip test "NULL into optional JObject" because "not implemented on" && the operating system
282
+
return
283
+
end if
284
+
285
+
if the operating system is "linux" then
286
+
skip test "NULL into optional JObject" because "bug 19934"
287
+
return
288
+
end if
289
+
209
290
MCUnitTestHandlerDoesntThrow(NullIntoOptionalJObject, "no error when putting NULL into optional JObject")
210
291
MCUnitTestHandlerThrows(NullIntoJObject, "type mismatch when putting NULL into non-optional JObject")
211
292
end handler
@@ -229,13 +310,33 @@ public handler NullParamJObject()
229
310
end handler
230
311
231
312
public handler TestNullJObjectParam()
313
+
if not the operating system is in ["mac", "linux"] then
314
+
skip test "NULL passed as optional JObject" because "not implemented on" && the operating system
315
+
return
316
+
end if
317
+
318
+
if the operating system is "linux" then
319
+
skip test "NULL passed as optional JObject" because "bug 19934"
320
+
return
321
+
end if
322
+
232
323
MCUnitTestHandlerDoesntThrow(NullParamOptionalJObject, "no error when passing NULL as optional JObject")
233
324
MCUnitTestHandlerThrows(NullParamJObject, "type mismatch when passing NULL as non-optional JObject")
234
325
end handler
235
326
236
327
foreign handler StringCodepointAt(in pSequence as JObject, in pIndex as JInt) returns JInt binds to "java:java.lang.Character>codePointAt(Ljava/lang/CharSequence;I)I!static"
237
328
238
329
public handler TestNativeTypeAfterObjectType()
330
+
if not the operating system is in ["mac", "linux"] then
331
+
skip test "called foreign handler with signature Ljava/lang/CharSequence;I" because "not implemented on" && the operating system
332
+
return
333
+
end if
334
+
335
+
if the operating system is "linux" then
336
+
skip test "called foreign handler with signature Ljava/lang/CharSequence;I" because "bug 19934"
337
+
return
338
+
end if
339
+
239
340
unsafe
240
341
variable tCodepoint as Integer
241
342
put StringCodepointAt(StringToJString("a"), 0) into tCodepoint
Copy file name to clipboardExpand all lines: tests/lcb/vm/foreign-binding.lcb
+22-12Lines changed: 22 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -9,50 +9,60 @@ use com.livecode.__INTERNAL._testlib
9
9
foreign handler SomeCFunctionWhichDoesNotExist() returns nothing binds to "<builtin>"
10
10
foreign handler MCValueCopyDescription(in pValue as any, out rDesc as String) returns CBool binds to "<builtin>"
11
11
12
-
private handler TestForeignBinding_NonExistantC()
12
+
private handler TestForeignBinding_NonExistentC()
13
13
unsafe
14
14
SomeCFunctionWhichDoesNotExist()
15
15
end unsafe
16
16
end handler
17
17
18
-
private handler TestForeignBinding_ExistantC()
18
+
private handler TestForeignBinding_ExistentC()
19
19
unsafe
20
20
variable tString as String
21
21
MCValueCopyDescription("", tString)
22
22
end unsafe
23
23
end handler
24
24
25
25
public handler TestForeignBinding_C()
26
-
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistantC, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existant C function throws error")
27
-
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistantC, "Binding to existant C function does not throw error")
26
+
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistentC, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existent C function throws error")
27
+
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistentC, "Binding to existent C function does not throw error")
28
28
29
-
test "Non-existant C function gives nothing as handler value" when SomeCFunctionWhichDoesNotExist is nothing
30
-
test "Existant C function gives non-nothing as handler value" when MCValueCopyDescription is not nothing
29
+
test "Non-existent C function gives nothing as handler value" when SomeCFunctionWhichDoesNotExist is nothing
30
+
test "Existent C function gives non-nothing as handler value" when MCValueCopyDescription is not nothing
31
31
end handler
32
32
33
33
---------
34
34
35
35
foreign handler CreateJavaObject() returns JObject binds to "java:java.lang.Object>new()"
36
36
foreign handler CreateJavaObjectDoesntExist() returns JObject binds to "java:java.lang.Object>new_doesnt_exist()"
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistantJava, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existant java function throws error")
52
-
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistantJava, "Binding to existant java function does not throw error")
51
+
if not the operating system is in ["mac", "linux"] then
52
+
skip test "(Non)existent java function" because "not implemented on" && the operating system
53
+
return
54
+
end if
55
+
56
+
if the operating system is "linux" then
57
+
skip test "(Non)existent java function" because "bug 19934"
58
+
return
59
+
end if
60
+
61
+
MCUnitTestHandlerThrowsNamed(TestForeignBinding_NonExistentJava, "livecode.lang.ForeignHandlerBindingError", "Failure to bind to non-existent java function throws error")
62
+
MCUnitTestHandlerDoesntThrow(TestForeignBinding_ExistentJava, "Binding to existent java function does not throw error")
53
63
54
-
test "Non-existant java function gives nothing as handler value" when CreateJavaObjectDoesntExist is nothing
55
-
test "Existant java function gives non-nothing as handler value" when CreateJavaObject is not nothing
64
+
test "Non-existent java function gives nothing as handler value" when CreateJavaObjectDoesntExist is nothing
65
+
test "Existent java function gives non-nothing as handler value" when CreateJavaObject is not nothing
0 commit comments