summaryrefslogtreecommitdiffstats
path: root/test/external.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-08 19:59:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-08 19:59:36 (GMT)
commit16683943c6edb42f9129cc5d6c8f340c74014dad (patch)
treed1ed13b0b7677e56d4253b4fe5e0640f851e27ca /test/external.c
parentd3ee3988b68292524b3a893b9db55c074f4b9e87 (diff)
downloadhdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.zip
hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.tar.gz
hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.tar.bz2
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2 Add simple regression test for H5Dopen1 Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test/external.c')
-rw-r--r--test/external.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/test/external.c b/test/external.c
index 0186d53..20ece60 100644
--- a/test/external.c
+++ b/test/external.c
@@ -106,42 +106,43 @@ test_1a(hid_t file)
hsize_t file_size; /*sizeof external file segment */
TESTING("fixed-size data space, exact storage");
+
/* Create the dataset */
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = max_size[0] = 100;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int))) < 0) goto error;
- if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error;
- if ((dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int))) < 0) goto error;
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0)
goto error;
- if (H5Dclose (dset) < 0) goto error;
- if (H5Sclose (space) < 0) goto error;
- if (H5Pclose (dcpl) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
/* Read dataset creation information */
- if ((dset = H5Dopen (file, "dset1")) < 0) goto error;
+ if((dset = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0) goto error;
/* Test dataset address. Should be undefined. */
- if (H5Dget_offset(dset)!=HADDR_UNDEF) goto error;
+ if(H5Dget_offset(dset) != HADDR_UNDEF) goto error;
- if ((dcpl = H5Dget_create_plist (dset)) < 0) goto error;
- if ((n=H5Pget_external_count (dcpl)) < 0) goto error;
- if (1!=n) {
+ if((dcpl = H5Dget_create_plist(dset)) < 0) goto error;
+ if((n = H5Pget_external_count(dcpl)) < 0) goto error;
+ if(1 != n) {
H5_FAILED();
puts(" Returned external count is wrong.");
printf(" got: %d\n ans: 1\n", n);
goto error;
}
- strcpy (name+sizeof(name)-4, "...");
- if (H5Pget_external (dcpl, 0, sizeof(name)-4, name, &file_offset,
+ HDstrcpy(name + sizeof(name) - 4, "...");
+ if(H5Pget_external(dcpl, 0, sizeof(name) - 4, name, &file_offset,
&file_size) < 0) goto error;
- if (file_offset!=0) {
+ if(file_offset != 0) {
H5_FAILED();
puts(" Wrong file offset.");
printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
goto error;
}
- if (file_size!=(max_size[0]*sizeof(int))) {
+ if(file_size != (max_size[0] * sizeof(int))) {
H5_FAILED();
puts(" Wrong file size.");
printf(" got: %lu\n ans: %lu\n", (unsigned long)file_size,
@@ -358,44 +359,45 @@ test_1e(hid_t file)
TESTING("unlimited dataspace, unlimited external storage");
/* Create dataset */
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0) goto error;
cur_size[0] = 100;
max_size[0] = H5S_UNLIMITED;
- if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
- if ((dset=H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((dset = H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0)
goto error;
- if (H5Dclose (dset) < 0) goto error;
- if (H5Sclose (space) < 0) goto error;
- if (H5Pclose (dcpl) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
/* Read dataset creation information */
- if ((dset = H5Dopen (file, "dset5")) < 0) goto error;
- if ((dcpl = H5Dget_create_plist (dset)) < 0) goto error;
- if ((n = H5Pget_external_count (dcpl)) < 0) goto error;
- if (1!=n) {
+ if((dset = H5Dopen2(file, "dset5", H5P_DEFAULT)) < 0) goto error;
+ if((dcpl = H5Dget_create_plist(dset)) < 0) goto error;
+ if((n = H5Pget_external_count(dcpl)) < 0) goto error;
+ if(1 != n) {
H5_FAILED();
puts(" Returned external count is wrong.");
printf(" got: %d\n ans: 1\n", n);
goto error;
}
- strcpy (name+sizeof(name)-4, "...");
- if (H5Pget_external (dcpl, 0, sizeof(name)-4, name, &file_offset,
+ HDstrcpy(name + sizeof(name) - 4, "...");
+ if(H5Pget_external(dcpl, 0, sizeof(name) - 4, name, &file_offset,
&file_size) < 0) goto error;
- if (file_offset!=0) {
+ if(file_offset != 0) {
H5_FAILED();
puts(" Wrong file offset.");
printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset);
goto error;
}
- if (H5F_UNLIMITED!=file_size) {
+ if(H5F_UNLIMITED != file_size) {
H5_FAILED();
puts(" Wrong file size.");
printf(" got: %lu\n ans: INF\n", (unsigned long)file_size);
goto error;
}
- if (H5Pclose (dcpl) < 0) goto error;
- if (H5Dclose (dset) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
+
PASSED();
return 0;