diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-11-24 15:44:27 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-11-24 15:44:27 (GMT) |
commit | 2c940aa9170e1c577a036b78064b91a0d340ac47 (patch) | |
tree | 0dc16862e7898b1ba888b295e93a72f1ef08531d /hl/test | |
parent | c731eb9d37eac096326abc87dcda6c471af46f63 (diff) | |
download | hdf5-2c940aa9170e1c577a036b78064b91a0d340ac47.zip hdf5-2c940aa9170e1c577a036b78064b91a0d340ac47.tar.gz hdf5-2c940aa9170e1c577a036b78064b91a0d340ac47.tar.bz2 |
[svn-r9571] Purpose:
bug fix
Description:
the string build of some test files using "srcdir" was not done properly
Solution:
Platforms tested:
linux
Misc. update:
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/test_table.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/hl/test/test_table.c b/hl/test/test_table.c index fa1fbc1..b791fe1 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -18,6 +18,11 @@ #include <stdlib.h> #include <assert.h> +#define TEST_FILE_BE "test_table_be.hdf5" +#define TEST_FILE_LE "test_table_le.hdf5" +#define TEST_FILE_CRAY "test_table_cray.hdf5" + + /*------------------------------------------------------------------------- * Table API test * @@ -1446,11 +1451,7 @@ int main(void) { hid_t fid; /* identifier for the file */ unsigned flags=H5F_ACC_RDONLY; - char *srcdir = getenv("srcdir"); /* the source directory */ - char data_file[512]=""; /* buffer to hold name of existing data file */ - - - + /*------------------------------------------------------------------------- * test1: create a file for the write/read test *------------------------------------------------------------------------- @@ -1474,15 +1475,7 @@ int main(void) */ puts("Testing table with file open mode (read big-endian data):"); - /* compose the name of the file to open, using the srcdir, if appropriate */ - if ( srcdir ) - { - strcpy(data_file, srcdir); - strcat(data_file, "/"); - } - strcat( data_file, "test_table_be.hdf5"); - - fid=h5file_open(data_file,flags); + fid=h5file_open(TEST_FILE_BE,flags); /* test, do not write */ if (test_table(fid,0)<0) @@ -1497,15 +1490,7 @@ int main(void) */ puts("Testing table with file open mode (read little-endian data):"); - /* compose the name of the file to open, using the srcdir, if appropriate */ - if ( srcdir ) - { - strcpy(data_file, srcdir); - strcat(data_file, "/"); - } - strcat( data_file, "test_table_le.hdf5"); - - fid=h5file_open(data_file,flags); + fid=h5file_open(TEST_FILE_LE,flags); /* test, do not write */ if (test_table(fid,0)<0) @@ -1520,15 +1505,7 @@ int main(void) */ puts("Testing table with file open mode (read Cray data):"); - /* compose the name of the file to open, using the srcdir, if appropriate */ - if ( srcdir ) - { - strcpy(data_file, srcdir); - strcat(data_file, "/"); - } - strcat( data_file, "test_table_cray.hdf5"); - - fid=h5file_open(data_file,flags); + fid=h5file_open(TEST_FILE_CRAY,flags); /* test, do not write */ if (test_table(fid,0)<0) |