2014-01-21 07:11:45 +08:00
|
|
|
#include "config.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <netcdf.h>
|
|
|
|
|
|
|
|
|
2014-10-05 05:59:16 +08:00
|
|
|
#define URL1 "http://%s" /* test that no trailing / is ok */
|
|
|
|
static char url1[1024];
|
2014-01-21 07:11:45 +08:00
|
|
|
|
2014-10-05 05:59:16 +08:00
|
|
|
#ifdef DEBUG
|
2014-01-21 07:11:45 +08:00
|
|
|
static void
|
|
|
|
CHECK(int e, const char* msg)
|
|
|
|
{
|
|
|
|
if(e == NC_NOERR) return;
|
|
|
|
if(msg == NULL) msg = "Error";
|
|
|
|
printf("%s: %s\n", msg, nc_strerror(e));
|
|
|
|
exit(1);
|
|
|
|
}
|
2014-10-05 05:59:16 +08:00
|
|
|
#endif
|
2014-01-21 07:11:45 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
XFAIL(int e, const char* msg)
|
|
|
|
{
|
|
|
|
if(e == NC_NOERR) return;
|
|
|
|
if(msg == NULL) msg = "XFAIL";
|
|
|
|
printf("%s: %s\n", msg, nc_strerror(e));
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
int ncid,retval;
|
|
|
|
|
2014-10-05 05:59:16 +08:00
|
|
|
{
|
|
|
|
char* evv = getenv("DTSTESTSERVER");
|
|
|
|
if(evv == NULL)
|
|
|
|
evv = "remotetest.unidata.ucar.edu";
|
|
|
|
snprintf(url1,sizeof(url1),URL1,evv);
|
|
|
|
}
|
|
|
|
|
2014-01-21 07:11:45 +08:00
|
|
|
printf("Testing: Misc. Tests \n");
|
2014-10-05 05:59:16 +08:00
|
|
|
retval = nc_open(url1, 0, &ncid);
|
2014-01-21 07:11:45 +08:00
|
|
|
XFAIL(retval,"*** XFail : No trailing slash in url");
|
|
|
|
retval = nc_close(ncid);
|
|
|
|
return 0;
|
|
|
|
}
|