summaryrefslogtreecommitdiffstats
path: root/test/tmisc.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/tmisc.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/tmisc.c')
-rw-r--r--test/tmisc.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/test/tmisc.c b/test/tmisc.c
index 2752f42..728200e 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -1723,20 +1723,12 @@ test_misc10(void)
hid_t dataset, dataset_new; /* Dataset IDs for old & new datasets */
hid_t dcpl; /* Dataset creation property list */
hid_t space, type; /* Old dataset's dataspace & datatype */
- char testfile[512]=""; /* Character buffer for corrected test file name */
- char *srcdir = HDgetenv("srcdir"); /* Pointer to the directory the source code is located within */
+ const char *testfile = H5_get_srcdir_filename(MISC10_FILE_OLD); /* Corrected test file name */
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing using old dataset creation property list\n"));
- /* Generate the correct name for the test file, by prepending the source path */
- if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) {
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, MISC10_FILE_OLD);
-
/*
* Open the old file and the dataset and get old settings.
*/
@@ -3387,8 +3379,7 @@ test_misc20(void)
hsize_t small_dims[MISC20_SPACE_RANK]={MISC20_SPACE2_DIM0,MISC20_SPACE2_DIM1}; /* Small dimensions */
unsigned version; /* Version of storage layout info */
hsize_t contig_size; /* Size of contiguous storage size from layout into */
- char testfile[512]=""; /* Character buffer for corrected test file name */
- char *srcdir = HDgetenv("srcdir"); /* Pointer to the directory the source code is located within */
+ const char *testfile = H5_get_srcdir_filename(MISC20_FILE_OLD); /* Corrected test file name */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -3502,13 +3493,6 @@ test_misc20(void)
/* Verify that the storage size is computed correctly for older versions of layout info */
- /* Generate the correct name for the test file, by prepending the source path */
- if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC20_FILE_OLD) + 1) < sizeof(testfile))) {
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, MISC20_FILE_OLD);
-
/*
* Open the old file and the dataset and get old settings.
*/
@@ -4630,20 +4614,12 @@ test_misc25b(void)
{
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
- char testfile[512]="";
- char *srcdir = HDgetenv("srcdir");
+ const char *testfile = H5_get_srcdir_filename(MISC25B_FILE); /* Corrected test file name */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Exercise null object header message bug\n"));
- /* Build the name of the file, with the source directory */
- if (srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC25B_FILE) + 1) < sizeof(testfile))){
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, MISC25B_FILE);
-
/* Open file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -4895,20 +4871,12 @@ test_misc27(void)
{
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
- char testfile[512]=""; /* Character buffer for corrected test file name */
- char *srcdir = HDgetenv("srcdir"); /* Pointer to the directory the source code is located within */
+ const char *testfile = H5_get_srcdir_filename(MISC27_FILE); /* Corrected test file name */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Corrupt object header handling\n"));
- /* Generate the correct name for the test file, by prepending the source path */
- if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC27_FILE) + 1) < sizeof(testfile))) {
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, MISC27_FILE);
-
/* Open the file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");