summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-03-17 21:38:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-03-17 21:38:20 (GMT)
commitfd547cd11ffa59c66aa93a5c55f6b979792e76d7 (patch)
treefcca518af22b90099a766da4419e593d373cd390 /test/dsets.c
parent8a14f5dc0ecf2a550916d5fd8ff5804d6e641240 (diff)
downloadhdf5-fd547cd11ffa59c66aa93a5c55f6b979792e76d7.zip
hdf5-fd547cd11ffa59c66aa93a5c55f6b979792e76d7.tar.gz
hdf5-fd547cd11ffa59c66aa93a5c55f6b979792e76d7.tar.bz2
[svn-r18413] Description:
Unify srcdir handling for test executables and allow them to use the srcdir setting from configure time without requiring the 'srcdir' environment variable be set (although you still can, to override the built in setting). Attempted to get this right for Windows builds also. Also add dependency between src/H5Tinit.c and src/libhdf5.settings, so that the test/testcheck_version.sh script works correctly. Tested on: Linux/32 2.6 (jam) Mac OS X/32 10.6.2 (amazon)
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 46355c1..c17e90c 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -2256,8 +2256,7 @@ test_missing_filter(hid_t file)
hsize_t dset_size; /* Dataset size */
size_t i,j; /* Local index variables */
herr_t ret; /* Generic return value */
- char testfile[512]=""; /* Buffer to hold name of existing test file */
- char *srcdir = HDgetenv("srcdir"); /* The source directory, if we are using the --srcdir configure option */
+ const char *testfile = H5_get_srcdir_filename(FILE_DEFLATE_NAME); /* Corrected test file name */
TESTING("dataset access with missing filter");
@@ -2403,13 +2402,6 @@ test_missing_filter(hid_t file)
/* Try reading existing dataset with deflate filter */
- /* Compose the name of the file to open, using the srcdir, if appropriate */
- if(srcdir && ((HDstrlen(srcdir) + HDstrlen(FILE_DEFLATE_NAME) + 1) < sizeof(testfile))){
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, FILE_DEFLATE_NAME);
-
/* Open existing file */
if((fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED();
@@ -5935,8 +5927,7 @@ test_filters_endianess(void)
hid_t dsid=-1; /* dataset ID */
hid_t sid=-1; /* dataspace ID */
hid_t dcpl=-1; /* dataset creation property list ID */
- char *srcdir = getenv("srcdir"); /* the source directory */
- char data_file[512]=""; /* buffer to hold name of existing file */
+ const char *data_file = H5_get_srcdir_filename("test_filters_le.hdf5"); /* Corrected test file name */
TESTING("filters with big-endian/little-endian data");
@@ -5946,14 +5937,6 @@ test_filters_endianess(void)
*-------------------------------------------------------------------------
*/
- /* compose the name of the file to open, using the srcdir, if appropriate */
- HDstrcpy(data_file, "");
- if(srcdir) {
- HDstrcpy(data_file, srcdir);
- HDstrcat(data_file, "/");
- }
- HDstrcat(data_file, "test_filters_le.hdf5");
-
/* open */
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -5969,12 +5952,7 @@ test_filters_endianess(void)
*/
/* compose the name of the file to open, using the srcdir, if appropriate */
- HDstrcpy(data_file, "");
- if(srcdir) {
- HDstrcpy(data_file, srcdir);
- HDstrcat(data_file, "/");
- }
- HDstrcat(data_file, "test_filters_be.hdf5");
+ data_file = H5_get_srcdir_filename("test_filters_be.hdf5"); /* Corrected test file name */
/* open */
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR