diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2009-10-20 15:08:56 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2009-10-20 15:08:56 (GMT) |
commit | a99a73d20ecd7ed2c9c65a2979f600f805d01099 (patch) | |
tree | 252d65e11b3542322b0e73b510a1a3ef3036b7c4 /test/tmisc.c | |
parent | 4feddbbbcc655ba2ff2e07b10647bd12f06d2d84 (diff) | |
download | hdf5-a99a73d20ecd7ed2c9c65a2979f600f805d01099.zip hdf5-a99a73d20ecd7ed2c9c65a2979f600f805d01099.tar.gz hdf5-a99a73d20ecd7ed2c9c65a2979f600f805d01099.tar.bz2 |
[svn-r17688] Merge make local copy of svn test data files for write access from v1.8 to trunk.
Tested:
amani, jam, linew (h5committest).
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index 21715b4..55e4c27 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -32,9 +32,6 @@ #include "testhdf5.h" #include "H5Dpkg.h" /* Datasets */ -#define NAME_BUF_SIZE 1024 -#define READ_OLD_BUFSIZE 1024 - /* Definitions for misc. test #1 */ #define MISC1_FILE "tmisc1.h5" #define MISC1_VAL (13417386) /* 0xccbbaa */ @@ -5124,39 +5121,15 @@ test_misc28(void) static void test_misc29(void) { - int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ - char buf[READ_OLD_BUFSIZE]; /* Buffer for copying data */ - ssize_t nread; /* Number of bytes read in */ - char *srcdir = HDgetenv("srcdir"); /* where the src code is located */ - char filename[NAME_BUF_SIZE] = ""; /* old test file name */ hid_t fid; /* File ID */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Speculative metadata reads\n")); - /* Generate correct name for test file by prepending the source path */ - if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC29_ORIG_FILE) + 1) < sizeof(filename))) { - HDstrcpy(filename, srcdir); - HDstrcat(filename, "/"); - } /* end if */ - HDstrcat(filename, MISC29_ORIG_FILE); - - /* Copy old file into temporary file */ - fd_old = HDopen(filename, O_RDONLY, 0666); - CHECK(fd_old, -1, "HDopen"); - fd_new = HDopen(MISC29_COPY_FILE, O_RDWR|O_CREAT|O_TRUNC, 0666); - CHECK(fd_new, -1, "HDopen"); - - /* Copy data */ - while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) - HDwrite(fd_new, buf, (size_t)nread); - - /* Close files */ - ret = HDclose(fd_old); - CHECK(ret, -1, "HDclose"); - ret = HDclose(fd_new); - CHECK(ret, -1, "HDclose"); + /* Make a copy of the data file from svn. */ + ret = h5_make_local_copy(MISC29_ORIG_FILE, MISC29_COPY_FILE); + CHECK(ret, -1, "h5_make_local_copy"); /* Open the copied file */ fid = H5Fopen(MISC29_COPY_FILE, H5F_ACC_RDWR, H5P_DEFAULT); |