summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/big.c9
-rw-r--r--test/chunk.c12
-rw-r--r--test/cmpd_dset.c5
-rw-r--r--test/dsets.c7
-rw-r--r--test/dtypes.c7
-rw-r--r--test/external.c7
-rw-r--r--test/fillval.c8
-rw-r--r--test/iopipe.c43
-rw-r--r--test/links.c4
-rw-r--r--test/mount.c4
-rw-r--r--test/mtime.c7
-rw-r--r--test/ragged.c16
-rw-r--r--test/shtype.c5
-rw-r--r--test/unlink.c4
14 files changed, 131 insertions, 7 deletions
diff --git a/test/big.c b/test/big.c
index c2c81bf..108c1de 100644
--- a/test/big.c
+++ b/test/big.c
@@ -21,8 +21,11 @@
#define WRT_N 50
#define WRT_SIZE 4*1024
#define FAMILY_SIZE 1024*1024*1024
+#if defined(WIN32)
+#define GB8LL ((unsigned __int64)8*1024*1024*1024)
+#else
#define GB8LL ((unsigned long long)8*1024*1024*1024)
-
+#endif
static hsize_t
randll (hsize_t limit)
{
@@ -87,7 +90,11 @@ is_sparse(void)
if (5!=write(fd, "hello", 5)) return 0;
if (stat("x.h5", &sb)<0) return 0;
if (unlink("x.h5")<0) return 0;
+#if !defined(WIN32)
return (sb.st_blocks*512 < (unsigned)sb.st_size);
+#else
+ return (0);
+#endif
}
diff --git a/test/chunk.c b/test/chunk.c
index 92279ac..c0cbb9f 100644
--- a/test/chunk.c
+++ b/test/chunk.c
@@ -25,6 +25,11 @@
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
+
#define FILE_NAME "chunk.h5"
#define LINESPOINTS "lines"
#define CH_SIZE 100 /*squared in terms of bytes */
@@ -235,7 +240,12 @@ static double
test_diag (int op, hsize_t cache_size, hsize_t io_size, hsize_t offset)
{
hid_t file, dset, mem_space, file_space;
- hsize_t i, hs_size[2], nio=0;
+ hsize_t i, hs_size[2];
+#if defined(WIN32)
+ hssize_t nio = 0;
+#else
+ hsize_t nio = 0;
+#endif
hssize_t hs_offset[2];
char *buf = calloc (1, SQUARE (io_size));
int mdc_nelmts, rdcc_nelmts;
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 534f3d6..92671e5 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -21,6 +21,11 @@
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
+
#define TEST_FILE_NAME "cmpd_dset.h5"
/* The first dataset */
diff --git a/test/dsets.c b/test/dsets.c
index 104ee11..a929842 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -13,8 +13,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#if !defined(WIN32)
#include <unistd.h>
-
+#endif
#include <H5config.h>
#ifndef HAVE_ATTRIBUTE
# undef __attribute__
@@ -23,6 +24,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
#ifndef HAVE_FUNCTION
# undef __FUNCTION__
diff --git a/test/dtypes.c b/test/dtypes.c
index 6949250..f35b3da 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -15,8 +15,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
+#if !defined (WIN32)
#include <sys/wait.h>
#include <unistd.h>
+#endif
+
#define H5T_PACKAGE
#include <H5Tpkg.h> /*to turn off hardware conversions*/
@@ -29,6 +32,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
#if SIZEOF_DOUBLE != SIZEOF_LONG_DOUBLE
# define USE_LDOUBLE
diff --git a/test/external.c b/test/external.c
index 03943f8..28fd264 100644
--- a/test/external.c
+++ b/test/external.c
@@ -13,7 +13,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#if !defined(WIN32)
#include <unistd.h>
+#endif
#include <H5config.h>
#ifndef HAVE_ATTRIBUTE
@@ -24,6 +26,11 @@
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
+
#define TEST_FILE_NAME1 "extern_1.h5"
#define TEST_FILE_NAME2 "extern_2.h5"
#define TEST_FILE_NAME3 "extern_3.h5"
diff --git a/test/fillval.c b/test/fillval.c
index e4d66a9..23673fc 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -10,8 +10,9 @@
#include <fcntl.h>
#include <hdf5.h>
#include <stdlib.h>
+#if !defined(WIN32)
#include <unistd.h>
-
+#endif
/*
* Define NO_FILLING if you want to compare how this test works when there is
* no fill value (that is, when the fill value is zero).
@@ -35,7 +36,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
-
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
/*-------------------------------------------------------------------------
* Function: cleanup
diff --git a/test/iopipe.c b/test/iopipe.c
index 95d162d..bac63e1 100644
--- a/test/iopipe.c
+++ b/test/iopipe.c
@@ -13,9 +13,16 @@
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
+
+
+#if defined(WIN32)
+#include <time.h>
+#include <Winsock.h>
+#else
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
+#endif
#define RAW_FILE_NAME "iopipe.raw"
#define HDF5_FILE_NAME "iopipe.h5"
@@ -141,13 +148,21 @@ synchronize (void)
int
main (void)
{
+#if defined(WIN32)
+ static hssize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y};
+#else
static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y};
+#endif
static int nread=NREAD_REQUESTS, nwrite=NWRITE_REQUESTS;
unsigned char *the_data = NULL;
hid_t file, dset, file_space=-1;
herr_t status;
+#if !defined(WIN32)
struct rusage r_start, r_stop;
+#else
+ struct timeval r_start, r_stop;
+#endif
struct timeval t_start, t_stop;
int i, fd;
hssize_t n;
@@ -179,7 +194,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "fill raw");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
@@ -189,7 +206,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("fill raw",
&r_start, &r_stop, &t_start, &t_stop,
@@ -201,7 +220,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "fill hdf5");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@@ -213,7 +234,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("fill hdf5",
&r_start, &r_stop, &t_start, &t_stop,
@@ -224,7 +247,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "out raw");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
@@ -237,7 +262,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("out raw",
&r_start, &r_stop, &t_start, &t_stop,
@@ -248,7 +275,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "out hdf5");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
@@ -260,7 +289,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("out hdf5",
&r_start, &r_stop, &t_start, &t_stop,
@@ -271,7 +302,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "in raw");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@@ -284,7 +317,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("in raw",
&r_start, &r_stop, &t_start, &t_stop,
@@ -296,7 +331,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "in hdf5");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@@ -308,7 +345,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("in hdf5",
&r_start, &r_stop, &t_start, &t_stop,
@@ -324,7 +363,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_start);
#endif
+#if !defined(WIN32)
gettimeofday (&t_start, NULL);
+#endif
fprintf (stderr, HEADING, "in hdf5 partial");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
@@ -336,7 +377,9 @@ main (void)
#ifdef HAVE_GETRUSAGE
getrusage (RUSAGE_SELF, &r_stop);
#endif
+#if !defined(WIN32)
gettimeofday (&t_stop, NULL);
+#endif
putc ('\n', stderr);
print_stats ("in hdf5 partial",
&r_start, &r_stop, &t_start, &t_stop,
diff --git a/test/links.c b/test/links.c
index 013d8b8..5dc9d89 100644
--- a/test/links.c
+++ b/test/links.c
@@ -20,6 +20,10 @@
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
#define TEST_FILE_NAME "links.h5"
#define FALSE 0
diff --git a/test/mount.c b/test/mount.c
index b3b5a0b..4716795 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -26,6 +26,10 @@
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
/*-------------------------------------------------------------------------
* Function: cleanup
diff --git a/test/mtime.c b/test/mtime.c
index 3fdb97c..2a5e797 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -13,7 +13,9 @@
#include <assert.h>
#include <hdf5.h>
#include <math.h>
+#if !defined(WIN32)
#include <sys/time.h>
+#endif
#include <time.h>
#define FALSE 0
@@ -28,7 +30,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
-
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
/*-------------------------------------------------------------------------
* Function: display_error_cb
diff --git a/test/ragged.c b/test/ragged.c
index f89412d..f55d0f9 100644
--- a/test/ragged.c
+++ b/test/ragged.c
@@ -196,7 +196,11 @@ ragged_write_all(hid_t ra, hsize_t rows_at_once)
hssize_t row; /*current row number */
hsize_t i; /*counter */
hsize_t max_width = quant_g[NELMTS(quant_g)-1].hi;
+#if !defined(WIN32)
hsize_t interval_nelmts; /*elmts/interval timer */
+#else
+ hssize_t interval_nelmts; /*elmts/interval timer */
+#endif
hsize_t *size=NULL; /*size of each row */
void **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */
@@ -298,7 +302,11 @@ ragged_read_all(hid_t ra, hsize_t rows_at_once)
int total_nelmts=0;
hsize_t i, j; /*counters */
hssize_t row; /*current row number */
+#if !defined(WIN32)
hsize_t interval_nelmts; /*elmts/interval timer */
+#else
+ hssize_t interval_nelmts; /*elmts/interval timer */
+#endif
hsize_t *size=NULL; /*size of each row */
C_MTYPE **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */
@@ -429,8 +437,14 @@ ragged_read_short(hid_t ra, hsize_t rows_at_once, hsize_t width)
int total_nelmts=0;
hsize_t i, j;
hssize_t row; /*current row number */
+#if !defined(WIN32)
hsize_t interval_nelmts; /*elmts/interval timer */
- hsize_t read_nelmts=0; /*total elements read */
+ hsize_t read_nelmts=0; /*total elements read */
+#else
+ hssize_t read_nelmts=0; /*total elements read */
+ hssize_t interval_nelmts; /*elmts/interval timer */
+#endif
+
hsize_t *size=NULL; /*size of each row */
C_MTYPE **buf=NULL; /*buffer for each row */
H5_timer_t timer, timer_total; /*performance timers */
diff --git a/test/shtype.c b/test/shtype.c
index c86998d..80eccc0 100644
--- a/test/shtype.c
+++ b/test/shtype.c
@@ -20,6 +20,11 @@
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
+
#define TEST_FILE_NAME0 "shtype0.h5"
#define TEST_FILE_NAME1 "shtype1.h5"
#define TEST_FILE_NAME2A "shtype2a.h5"
diff --git a/test/unlink.c b/test/unlink.c
index a3ec4a2..c4e6d2c 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -18,6 +18,10 @@
#else
# define __unused__ __attribute__((unused))
#endif
+#if defined(WIN32)
+#undef __unused__
+#define __unused__
+#endif
#define FILE_NAME_1 "unlink.h5"
#define THE_OBJECT "/foo"