Skip to content

Commit b37ca1d

Browse files
committed
prevent signature confusion in test case
1 parent a82bb8b commit b37ca1d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_signature.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,14 @@ def test_calc_signature(self):
186186
self.assertTrue(obj.was_long)
187187

188188
clz = autoclass("org.jnius.SignatureTest$ShortOrLong")
189-
obj = clz(0) # could be short or long
190-
# this isnt truly deterministic, the two possible methods are tied for score
189+
# short and long would be tied, 0 could be short or long
190+
obj = clz(0, signature="(S)V") # so lets tell it is a short
191191
self.assertTrue(obj.was_short)
192192

193-
obj = clz(sys.maxsize)
193+
obj = clz(0, signature="(J)V") # lets tell it is a long
194+
self.assertFalse(obj.was_short)
195+
196+
obj = clz(sys.maxsize) # this should be a long
194197
self.assertFalse(obj.was_short)
195198

196199
autoclass("org.jnius.SignatureTest$ShortOnly")(0) # this should work as short

0 commit comments

Comments
 (0)