From 8078e59077b24fea61e31fec57f3fcbd4321489d Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Tue, 5 Apr 2016 14:58:01 +0800 Subject: [PATCH] test_h5types: also test ndarrays --- artiq/test/test_h5types.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/artiq/test/test_h5types.py b/artiq/test/test_h5types.py index 0b771a92d..c64a9c2e5 100644 --- a/artiq/test/test_h5types.py +++ b/artiq/test/test_h5types.py @@ -16,8 +16,11 @@ class TypesCase(unittest.TestCase): } for size in 8, 16, 32, 64: - d["i"+str(size)] = getattr(np, "int" + str(size))(42) - d["u"+str(size)] = getattr(np, "uint" + str(size))(42) + for typ in "int", "uint": + dt = getattr(np, typ + str(size)) + d[typ+str(size)] = dt(42) + d["n"+typ+str(size)] = np.array(42, dt) + d["m"+typ+str(size)] = np.array([[[[42]]]], dt) for size in 16, 32, 64: d["f"+str(size)] = getattr(np, "float" + str(size))(42)