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 -->
9msgerr = msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), "h5isSpace", 1);
10assert_checkerror("h5isSpace()",msgerr,77);
11assert_checkfalse(h5isSpace(42));
12assert_checkfalse(h5isSpace("42"));
13w = "testing";
14x = 1:10;
15y = [1 2;3 4];
16z = 1;
17save(TMPDIR + "/w.sod", "w");
18save(TMPDIR + "/x.sod", "x");
19save(TMPDIR + "/y.sod", "y");
20save(TMPDIR + "/z.sod", "z");
21a = h5open(TMPDIR + "/w.sod", "r");
22assert_checkfalse(h5isSpace(a));
23assert_checkfalse(h5isSpace(a.root));
24assert_checkfalse(h5isSpace(a.root.w));
25assert_checktrue(h5isSpace(a.root.w.dataspace));
26h5close(a);
27b = h5open(TMPDIR + "/x.sod", "r");
28assert_checkfalse(h5isSpace(b));
29assert_checkfalse(h5isSpace(b.root));
30assert_checkfalse(h5isSpace(b.root.x));
31assert_checktrue(h5isSpace(b.root.x.dataspace));
32h5close(b);
33c = h5open(TMPDIR + "/y.sod", "r");
34assert_checkfalse(h5isSpace(c));
35assert_checkfalse(h5isSpace(c.root));
36assert_checkfalse(h5isSpace(c.root.y));
37assert_checktrue(h5isSpace(c.root.y.dataspace));
38h5close(c);
39d = h5open(TMPDIR + "/z.sod", "r");
40assert_checkfalse(h5isSpace(d));
41assert_checkfalse(h5isSpace(d.root));
42assert_checkfalse(h5isSpace(d.root.z));
43assert_checktrue(h5isSpace(d.root.z.dataspace));
44h5close(d);
45