summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2020-04-13 00:11:59 +0200
committerMarcus Müller <marcus@hostalia.de>2020-04-13 10:44:18 +0200
commit596c6495f3bdf579dae0c26531a16f6adcc7fb2f (patch)
tree43ff46d4e363d5f31cb61bd1cb649b761a23f9b7
parent9b3c9cf16ce486647e2e889ddf459928dcd2a4ea (diff)
pmt: conditionalize testing of long > 2³² on sizeof(long)
-rw-r--r--gnuradio-runtime/python/pmt/qa_pmt.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnuradio-runtime/python/pmt/qa_pmt.py b/gnuradio-runtime/python/pmt/qa_pmt.py
index 884bba7dd4..44f616cdae 100644
--- a/gnuradio-runtime/python/pmt/qa_pmt.py
+++ b/gnuradio-runtime/python/pmt/qa_pmt.py
@@ -18,6 +18,10 @@ class test_pmt(unittest.TestCase):
MAXINT32 = (2**31)-1
MININT32 = (-MAXINT32)-1
+ def setUp(self):
+ from ctypes import sizeof, c_long
+ self.sizeof_long = sizeof(c_long)
+
def test01(self):
a = pmt.intern("a")
b = pmt.from_double(123765)
@@ -112,6 +116,8 @@ class test_pmt(unittest.TestCase):
self.assertEqual(const,pmt.to_long(deser))
def test15(self):
+ if(self.sizeof_long <= 4):
+ return
const = self.MAXINT32 + 1
x_pmt = pmt.from_long(const)
s = pmt.serialize_str(x_pmt)
@@ -137,6 +143,8 @@ class test_pmt(unittest.TestCase):
self.assertEqual(const, x_long)
def test18(self):
+ if(self.sizeof_long <= 4):
+ return
const = self.MININT32 - 1
x_pmt = pmt.from_long(const)
s = pmt.serialize_str(x_pmt)