Skip to content

Commit

Permalink
Trying to test tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Jun 23, 2024
1 parent d487b32 commit f6849c5
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions test/jpypetest/test_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ def testMemoryByte(self):
jtype = jpype.JByte[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -328,11 +328,12 @@ def testMemoryInt(self):
jtype = jpype.JInt[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
print(dtype)
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -341,11 +342,11 @@ def testMemoryShort(self):
jtype = jpype.JShort[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -354,11 +355,11 @@ def testMemoryLong(self):
jtype = jpype.JLong[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -367,11 +368,11 @@ def testMemoryFloat(self):
jtype = jpype.JFloat[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -380,11 +381,11 @@ def testMemoryDouble(self):
jtype = jpype.JDouble[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -393,11 +394,11 @@ def testMemoryBoolean(self):
jtype = jpype.JBoolean[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "f", "d", "n", "N"):
for dtype in "c?bBhHiIlLqQfdnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

for dtype in ("s", "p", "P", "e"):
for dtype in "spP":
with self.assertRaises(Exception):
jtype(mv.cast(dtype))

Expand All @@ -406,7 +407,7 @@ def testMemoryChar(self):
jtype = jpype.JChar[:]

# Simple checks
for dtype in ("c", "?", "b", "B", "h", "H", "i", "I", "l", "L", "q", "Q", "n", "N"):
for dtype in "c?bBhHiIlLqQnN":
jtype(mv.cast(dtype))
jtype(mv.cast("@" + dtype))

Expand Down

0 comments on commit f6849c5

Please sign in to comment.