mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-24 16:04:40 +08:00
run tst_nc4internal for netcdf4 builds only
This commit is contained in:
parent
0e95d4c871
commit
96344631a8
@ -151,9 +151,9 @@ nc4_file_change_ncid(int ncid, int new_ncid)
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal Get info about a file on the list of libsrc4 open files. This is
|
||||
* used by dispatch layers that wish to use the libsrc4 metadata
|
||||
* model, but don't know about struct NC.
|
||||
* @internal Get info about a file on the list of libsrc4 open
|
||||
* files. This is used by dispatch layers that wish to use the libsrc4
|
||||
* metadata model, but don't know about struct NC.
|
||||
*
|
||||
* @param ncid The ncid of the file (aka ext_ncid).
|
||||
* @param path A pointer that gets file name (< NC_MAX_NAME). Igored
|
||||
@ -237,7 +237,7 @@ nc4_nc4f_list_add(NC *nc, const char *path, int mode)
|
||||
|
||||
/* There's always at least one open group - the root
|
||||
* group. Allocate space for one group's worth of information. Set
|
||||
* its hdf id, name, and a pointer to it's file structure. */
|
||||
* its grp id, name, and allocate associated empty lists. */
|
||||
if ((retval = nc4_grp_list_add(h5, NULL, NC_GROUP_NAME, &h5->root_grp)))
|
||||
return retval;
|
||||
|
||||
|
@ -14,8 +14,12 @@ include $(top_srcdir)/lib_flags.am
|
||||
# Find and link to the netcdf-c library.
|
||||
LDADD = ${top_builddir}/liblib/libnetcdf.la
|
||||
|
||||
check_PROGRAMS = tst_nclist tst_nc4internal
|
||||
TESTS = tst_nclist tst_nc4internal
|
||||
if USE_NETCDF4
|
||||
NC4_TESTS = tst_nc4internal
|
||||
endif # USE_NETCDF4
|
||||
|
||||
check_PROGRAMS = tst_nclist $(NC4_TESTS)
|
||||
TESTS = tst_nclist $(NC4_TESTS)
|
||||
|
||||
# If valgrind is present, add valgrind targets.
|
||||
@VALGRIND_CHECK_RULES@
|
||||
|
@ -23,10 +23,14 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
printf("\n*** Testing netcdf nc4internal functions.\n");
|
||||
printf("Testing adding new file to nc4internal file lists...");
|
||||
printf("Testing adding new file to nc4internal file lists with "
|
||||
"nc4_file_list_add()...");
|
||||
{
|
||||
NC *ncp;
|
||||
NCmodel model;
|
||||
char path[NC_MAX_NAME + 1];
|
||||
void *dispatchdata;
|
||||
int mode;
|
||||
|
||||
/* This won't work because there is no NC in the NC list which
|
||||
* has an ncid of TEST_VAL_42. */
|
||||
@ -45,6 +49,13 @@ main(int argc, char **argv)
|
||||
* to hold dims, types, groups, and the root group. */
|
||||
if (nc4_file_list_add(ncp->ext_ncid, FILE_NAME, 0, NULL)) ERR;
|
||||
|
||||
/* Find the file in the list. */
|
||||
if (nc4_file_list_get(ncp->ext_ncid, NULL, &mode, &dispatchdata)) ERR;
|
||||
/* if (nc4_file_list_get(ncp->ext_ncid, (char **)&path, &mode, &dispatchdata)) ERR; */
|
||||
|
||||
/* This won't work. */
|
||||
if (nc4_file_list_del(TEST_VAL_42) != NC_EBADID) ERR;
|
||||
|
||||
/* Delete the NC_FILE_INFO_T and related storage. */
|
||||
if (nc4_file_list_del(ncp->ext_ncid)) ERR;
|
||||
|
||||
@ -56,6 +67,11 @@ main(int argc, char **argv)
|
||||
free_NC(ncp);
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
printf("Testing adding new file to nc4internal file lists with "
|
||||
"nc4_nc4f_list_add()...");
|
||||
{
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
/* printf("Testing changing ncid..."); */
|
||||
/* { */
|
||||
/* NC *ncp, *ncp2; */
|
||||
|
Loading…
Reference in New Issue
Block a user