Re: [netcdf-porting] Failing test to open non-netcdf file

NOTE: The netcdf-porting mailing list is no longer active. The list archives are made available for historical reasons.

>> I built netcdf4.1.1 and 4.1.2beta 32 and 64 bits with VS2010. In all
>> builds the nc_test.exe pass all but 3 tests that are
>>
>>         FAILURE at line 105 of ..\..\..\nc_test\test_read.c: nc_open
>> of non-netCDF file: status = 2
>>         ### 1 FAILURES TESTING nc_open! ###
>
> Seems like what is happening here is that the test is trying an open of
> a file that is not a netcdf file, and getting an error code of 2 instead
> of the expected error code of -51 (NC_ENOTNC - not a netcdf file).
>
> Does the file that is being opened exist?

Good guess.
No the file does not exist but note that we are talking of test
program -- "nc_test" --  that ships with the with netcdf package.
The line in question has

err = nc_open("nc_test.o", NC_NOWRITE, &ncid);/* should fail */

If I create a dummy "nc_test.o" file than the tests pass.

>> Now, I cannot be absolutely sure (... but almost) that this is the
>> same reason why GMT crashes in a test where at a certain point it it
>> attempts to open a non-netcdf file.
>
> Not sure what GMT is...

Ah, sorry. GMT (http://gmt.soest.hawaii.edu/) is one of your oldest
'clients'. It uses netcdf for 20 years but up to now with 3.6.x
series.
I am trying to move to netcdf4 but this crash (Windows only) is a show stopper.

BTW the test 64 bits version of "nctest" crashes on the "ncsync" step.
The debugger shows that this happens at line 709 of

......\netcdf-4.1.2b\nctest\cdftests.c

      if (ncvarput(ncid0,dd_id,dd_start,dd_edges,(void *)dd_vals) == -1) {

where ncid0 has the suspicious value of 65536


> Well it can be investigated by firing up the debugger and seeing what is
> happening!

I can do it (as above) only at a very limit extent.

> Windows is actually supported for the C library, though not visual
> studio. For (ming32w generated) windows DLLs, get this file:
> ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf4_dlls_vs.zip

Thanks, but not really useful. We build a pure Windows package where
netcdf is only of the libraries. I don't know more and don't want to
mix Mingw and VS dlls. And I want also be able to compile 64 bits
versions.


Thanks

Joaquim



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-porting archives: