summaryrefslogtreecommitdiffstats
path: root/test/big.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2010-08-03 23:33:43 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2010-08-03 23:33:43 (GMT)
commite440364f8e53fd52ef97d56b84f93fe580c9e2b6 (patch)
treefa3d905c09e70466816d3203bfa887e8ed1f92ad /test/big.c
parent28ffed9ebf80f0fd0247ffdd117aafeab42efb19 (diff)
downloadhdf5-e440364f8e53fd52ef97d56b84f93fe580c9e2b6.zip
hdf5-e440364f8e53fd52ef97d56b84f93fe580c9e2b6.tar.gz
hdf5-e440364f8e53fd52ef97d56b84f93fe580c9e2b6.tar.bz2
[svn-r19166] Bug fix: 1917.
Description: test/big incorrectly determined not able to write files larger than 2GB and skipped the SEC2 and STDIO driver tests. The reason was because it was using off_t while the SEC2 driver is using lseek64 which expects off64_t type. Solution: Created a new HDoff_t which is set to off_t or off64_t or other appropriate type depending on which of lseek or lseek64 is available. Changed SEC2 file driver and the big test to use this common definition. Tested: In BP (AIX), using --enable and --disable-largefile, for both 32 and 64 bits modes. Did not do h5committest because: 1. the error was exposed in the remote BP machine; 2. the change is trivial.
Diffstat (limited to 'test/big.c')
-rw-r--r--test/big.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/big.c b/test/big.c
index dde9d7a..8d65559 100644
--- a/test/big.c
+++ b/test/big.c
@@ -32,8 +32,7 @@ const char *FILENAME[] = {
#define WRT_SIZE 4*1024
#define FAMILY_SIZE 1024*1024*1024
-/* Define big file as 2GB */
-#define BIG_FILE (off_t)0x80000000UL
+#define GB (HDoff_t)0x40000000L
#define MAX_TRIES 100
@@ -165,15 +164,15 @@ supports_big(void)
if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) return 0;
/* Write a few bytes at 2GB */
- if (HDlseek(fd, BIG_FILE, SEEK_SET)!=BIG_FILE) return 0;
+ if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) return 0;
if (5!=HDwrite(fd, "hello", (size_t)5)) return 0;
/* Write a few bytes at 4GB */
- if (HDlseek(fd, 2*BIG_FILE, SEEK_SET) != 2*BIG_FILE) return 0;
+ if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) return 0;
if (5!=HDwrite(fd, "hello", (size_t)5)) return 0;
if (HDclose(fd) < 0) return 0;
- if (HDunlink("y.h5") < 0) return 0;
+ if (HDremove("y.h5") < 0) return 0;
return (1);
}