Fixed a couple of tests on Windows,

Fixed some compile errors on Windows.
This commit is contained in:
Ward Fisher 2013-02-21 23:56:15 +00:00
parent ddf3c31bb0
commit 0444a6c711
5 changed files with 14 additions and 8 deletions

View File

@ -128,6 +128,7 @@ NCDEFAULT_get_vars(int ncid, int varid, const size_t * start,
size_t mystart[NC_MAX_VAR_DIMS];
size_t myedges[NC_MAX_VAR_DIMS];
ptrdiff_t mystride[NC_MAX_VAR_DIMS];
char *memptr = NULL;
status = NC_check_id (ncid, &ncp);
if(status != NC_NOERR) return status;
@ -213,7 +214,7 @@ NCDEFAULT_get_vars(int ncid, int varid, const size_t * start,
*/
/* memptr indicates where to store the next value */
char* memptr = value;
memptr = value;
odom_init(&odom,rank,mystart,myedges,mystride);

View File

@ -134,6 +134,8 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
size_t myedges[NC_MAX_VAR_DIMS];
ptrdiff_t mystride[NC_MAX_VAR_DIMS];
const char* memptr = value;
status = NC_check_id (ncid, &ncp);
if(status != NC_NOERR) return status;
@ -220,8 +222,6 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
to read larger chunks at a time.
*/
/* memptr indicates where to store the next value */
const char* memptr = value;
odom_init(&odom,rank,mystart,myedges,mystride);

View File

@ -428,7 +428,7 @@ memio_pad_length(ncio* nciop, off_t length)
if(newmem == NULL) return NC_ENOMEM;
/* zero out the extra memory */
memset((void*)(newmem+memio->alloc),0,(newsize - memio->alloc));
memset((void*)((char*)newmem+memio->alloc),0,(newsize - memio->alloc));
#ifdef DEBUG
fprintf(stderr,"realloc: %lu/%lu -> %lu/%lu\n",

View File

@ -41,6 +41,10 @@ ENDIF()
# Copy some test files from current source dir to out-of-tree build dir.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
IF(MSVC)
FILE(COPY ${COPY_FILES} DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}/)
ENDIF()
FOREACH(CTEST ${NC4_TESTS})
add_bin_test(nc_test4 ${CTEST})

View File

@ -120,7 +120,6 @@ tst_att_ordering(int cmode)
int
main(int argc, char **argv)
{
(void) signal(SIGFPE, SIG_IGN);
signed char schar_in[ATT_LEN], schar_out[ATT_LEN] = {NC_MIN_BYTE, 1, NC_MAX_BYTE};
unsigned char uchar_in[ATT_LEN], uchar_out[ATT_LEN] = {0, 128, NC_MAX_UBYTE};
@ -133,7 +132,8 @@ main(int argc, char **argv)
double double_in[ATT_LEN], double_out[ATT_LEN] = {-0.25, .5, 0.125};
long long longlong_in[ATT_LEN], longlong_out[ATT_LEN] = {-3123456789LL, 128LL, 3123456789LL};
unsigned long long ulonglong_in[ATT_LEN], ulonglong_out[ATT_LEN] = {0LL, 128LL, 3123456789LL};
(void) signal(SIGFPE, SIG_IGN);
printf("\n*** Testing netcdf-4 attribute functions.\n");
printf("*** testing really simple global atts...");
#define NUM_SIMPLE_ATTS 9
@ -351,9 +351,10 @@ main(int argc, char **argv)
/* for (i = 0; i < ATT_LEN; i++) */
/* if (float_in[i] != (float) longlong_out[i]) ERR; */
if (nc_get_att_float(ncid, NC_GLOBAL, ATT_UINT64_NAME, float_in)) ERR;
for (i = 0; i < ATT_LEN; i++)
#if !defined(_WIN32) && !defined(_WIN64)
for (i = 0; i < ATT_LEN; i++)
if (float_in[i] != (float) ulonglong_out[i]) ERR;
#endif
/* Read all atts (except text) as int. */
if (nc_get_att_int(ncid, NC_GLOBAL, ATT_SCHAR_NAME, int_in)) ERR;
for (i = 0; i < ATT_LEN; i++)