summaryrefslogtreecommitdiffstats
path: root/test/cross_read.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/cross_read.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/cross_read.c')
-rwxr-xr-xtest/cross_read.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/test/cross_read.c b/test/cross_read.c
index b036217..6ce38f2 100755
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -37,8 +37,7 @@ const char *FILENAME[] = {
static int read_data(char *fname)
{
- char pathname[1024];
- char *srcdir = getenv("srcdir"); /*where the src code is located*/
+ const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */
hid_t file, dataset; /* handles */
hid_t datatype;
hid_t dt;
@@ -47,14 +46,6 @@ static int read_data(char *fname)
int i, j;
unsigned nerrors = 0;
- pathname[0] = '\0';
- /* Generate correct name for test file by prepending the source path */
- if(srcdir && ((strlen(srcdir) + strlen(fname) + 1) < sizeof(pathname))) {
- strcpy(pathname, srcdir);
- strcat(pathname, "/");
- }
- strcat(pathname, fname);
-
/*
* Data and output buffer initialization.
*/