diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-26 18:55:36 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2007-03-26 18:55:36 (GMT) |
commit | 4eed634bcf57fc1253f77bea2256d407db098d51 (patch) | |
tree | f80a785164f1ecdc39aa16e9c3554eef259953a3 /test/tvlstr.c | |
parent | 00f32db756d2f11f9fddb8edc67850944aa5ee1d (diff) | |
download | hdf5-4eed634bcf57fc1253f77bea2256d407db098d51.zip hdf5-4eed634bcf57fc1253f77bea2256d407db098d51.tar.gz hdf5-4eed634bcf57fc1253f77bea2256d407db098d51.tar.bz2 |
[svn-r13542] Added a detection for zero-length VL data in H5T_conv_vlen to handle the case properly. This fix
was discovered by the user while Bug #717 was being fixed. Modefied the test, too.
Diffstat (limited to 'test/tvlstr.c')
-rw-r--r-- | test/tvlstr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/tvlstr.c b/test/tvlstr.c index 8212206..a7b2a32 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -256,7 +256,7 @@ test_vlstrings_basic(void) static void test_vlstrings_special(void) { - const char *wdata[SPACE1_DIM1] = {"one", "two", "", "four"}; + const char *wdata[SPACE1_DIM1] = {"one", "two", "", "\0"}; const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL}; char *rdata[SPACE1_DIM1]; /* Information read in */ char *fill; /* Fill value */ @@ -314,6 +314,10 @@ test_vlstrings_special(void) TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); continue; } /* end if */ + if((wdata[i]==NULL && rdata[i]!=NULL) || (rdata[i]==NULL && wdata[i]!=NULL)) { + TestErrPrintf("VL data values don't match!\n"); + continue; + } /* end if */ if( HDstrcmp(wdata[i],rdata[i]) != 0 ) { TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); continue; |