test: remove broken array return tests

Removed test cases that do not respect lifetime/scope constraint.
See discussion in artiq-zynq repo: M-Labs/artiq-zynq#119
Referred to the patch from @dnadlinger. 5faa30a837
This commit is contained in:
occheung 2021-08-30 13:10:02 +08:00
parent 5985f7efb5
commit 4619a33db4
1 changed files with 2 additions and 17 deletions

View File

@ -261,19 +261,7 @@ class _RPCCalls(EnvExperiment):
@kernel
def numpy_things(self):
return (numpy.int32(10), numpy.int64(20), numpy.array([42,]))
@kernel
def numpy_full(self):
return numpy.full(10, 20)
@kernel
def numpy_full_matrix(self):
return numpy.full((3, 2), 13)
@kernel
def numpy_nan(self):
return numpy.full(10, numpy.nan)
return (numpy.int32(10), numpy.int64(20))
@kernel
def builtin(self):
@ -302,14 +290,11 @@ class RPCCallsTest(ExperimentCase):
self.assertEqual(exp.kwargs2(), 2)
self.assertEqual(exp.args1kwargs2(), 2)
self.assertEqual(exp.numpy_things(),
(numpy.int32(10), numpy.int64(20), numpy.array([42,])))
(numpy.int32(10), numpy.int64(20)))
# Ensure lists of int64s don't decay to variable-length builtin integers.
list_int64 = exp.list_int64()
self.assertEqual(list_int64, [numpy.int64(1)])
self.assertTrue(isinstance(list_int64[0], numpy.int64))
self.assertTrue((exp.numpy_full() == numpy.full(10, 20)).all())
self.assertTrue((exp.numpy_full_matrix() == numpy.full((3, 2), 13)).all())
self.assertTrue(numpy.isnan(exp.numpy_nan()).all())
exp.builtin()
exp.async_in_try()