1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2012 - SCILAB ENTERPRISES - Simon GARESTE
4//
5//  This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- CLI SHELL MODE -->
9
10msgerr = msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), "h5isSpace", 1);
11assert_checkerror("h5isSpace()",msgerr,77);
12assert_checkfalse(h5isSpace(42));
13assert_checkfalse(h5isSpace("42"));
14
15w = "testing";
16x = 1:10;
17y = [1 2;3 4];
18z = 1;
19save(TMPDIR + "/w.sod", "w");
20save(TMPDIR + "/x.sod", "x");
21save(TMPDIR + "/y.sod", "y");
22save(TMPDIR + "/z.sod", "z");
23
24a = h5open(TMPDIR + "/w.sod", "r");
25assert_checkfalse(h5isSpace(a));
26assert_checkfalse(h5isSpace(a.root));
27assert_checkfalse(h5isSpace(a.root.w));
28assert_checktrue(h5isSpace(a.root.w.dataspace));
29h5close(a);
30
31b = h5open(TMPDIR + "/x.sod", "r");
32assert_checkfalse(h5isSpace(b));
33assert_checkfalse(h5isSpace(b.root));
34assert_checkfalse(h5isSpace(b.root.x));
35assert_checktrue(h5isSpace(b.root.x.dataspace));
36h5close(b);
37
38c = h5open(TMPDIR + "/y.sod", "r");
39assert_checkfalse(h5isSpace(c));
40assert_checkfalse(h5isSpace(c.root));
41assert_checkfalse(h5isSpace(c.root.y));
42assert_checktrue(h5isSpace(c.root.y.dataspace));
43h5close(c);
44
45d = h5open(TMPDIR + "/z.sod", "r");
46assert_checkfalse(h5isSpace(d));
47assert_checkfalse(h5isSpace(d.root));
48assert_checkfalse(h5isSpace(d.root.z));
49assert_checktrue(h5isSpace(d.root.z.dataspace));
50h5close(d);
51