summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/gr_unittest.py
diff options
context:
space:
mode:
authorDavid Sorber <david.sorber@blacklynx.tech>2021-05-12 08:59:21 -0400
committermormj <34754695+mormj@users.noreply.github.com>2021-10-25 11:27:01 -0400
commit788827ae116bef871e144abd39b1e4482208eabe (patch)
treedcfee04a77db5bb3c8042be5b0b95c54bf8759c9 /gnuradio-runtime/python/gnuradio/gr_unittest.py
parentb8713810a2d07ac1a632bd7bfb23f3f48f67e222 (diff)
runtime: Custom Buffer/Accelerator Device Support - Milestone 1
Custom Buffer/Accelerator Device Support - Milestone 1 changes: * Refactored existing single mapped buffer code and created single mapped buffer abstraction; wrapping within single mapped buffers is handled explicitly by input blocked and output blocked callbacks that are called from block_executor * Added simple custom buffer allocation interface (NOTE: this interface will change for milestone 2) * Accelerated blocks are still responsible for data transfer but the custom buffer interface eliminates the double copy problem Signed-off-by: David Sorber <david.sorber@blacklynx.tech>
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gr_unittest.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/gr_unittest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr_unittest.py b/gnuradio-runtime/python/gnuradio/gr_unittest.py
index 6177f0f32f..ebd47019a5 100644
--- a/gnuradio-runtime/python/gnuradio/gr_unittest.py
+++ b/gnuradio-runtime/python/gnuradio/gr_unittest.py
@@ -110,6 +110,25 @@ class TestCase(unittest.TestCase):
self.assertComplexAlmostEqual2(x, y, abs_eps, rel_eps, msg)
for (x, y) in zip(a, b)
])
+
+
+ def assertSequenceEqualGR(self, data_in, data_out):
+ """
+ Note this function exists because of this bug: https://bugs.python.org/issue19217
+ Calling self.assertEqual(seqA, seqB) can hang if seqA and seqB are not equal.
+ """
+ if len(data_in) != len(data_out):
+ print('Lengths do not match: {:d} -- {:d}'.format(len(data_in), len(data_out)))
+ self.assertTrue(len(data_in) == len(data_out))
+ total_miscompares = 0
+ for idx, item in enumerate(zip(data_in, data_out)):
+ if item[0] != item[1]:
+ total_miscompares += 1
+ print('Miscompare at: {:d} ({:d} -- {:d})'.format(idx, item[0], item[1]))
+ if total_miscompares > 0:
+ print('Total miscompares: {:d}'.format(total_miscompares))
+ self.assertTrue(total_miscompares == 0)
+
def waitFor(
self,