diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/external.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/external.c b/test/external.c index 902bc76..52eb4af 100644 --- a/test/external.c +++ b/test/external.c @@ -582,6 +582,7 @@ test_2 (hid_t fapl) hid_t hs_space; /*hyperslab data space */ hssize_t hs_start = 30; /*hyperslab starting offset */ hsize_t hs_count = 25; /*hyperslab size */ + int temparray[10] = {0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f}; TESTING("read external dataset"); @@ -593,7 +594,8 @@ test_2 (hid_t fapl) sprintf (filename, "extern_%lua.raw", (unsigned long)i+1); fd = HDopen (filename, O_RDWR|O_CREAT|O_TRUNC, 0666); assert (fd>=0); - n = lseek (fd, (off_t)(i*10), SEEK_SET); +// n = lseek (fd, (off_t)(i*10), SEEK_SET); + n = write(fd,temparray,i*10); assert (n>=0 && (size_t)n==i*10); n = write (fd, part, sizeof(part)); assert (n==sizeof(part)); @@ -706,6 +708,7 @@ test_3 (hid_t fapl) hssize_t hs_start=100; /*hyperslab starting offset */ hsize_t hs_count=100; /*hyperslab size */ char filename[1024]; /*file name */ + int temparray[10] = {0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f,0x0f0f0f0f0f}; TESTING("write external dataset"); @@ -731,6 +734,8 @@ test_3 (hid_t fapl) printf(" cannot open %s: %s\n", filename, strerror(errno)); goto error; } + + write(fd, temparray, (i-1)*10); close (fd); } |