summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2011-06-06 17:05:37 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2011-06-06 17:05:37 (GMT)
commitaabfb1d7567ed7b69ec2d4b10bb254aec9cabbc3 (patch)
tree0c0721cb078b71c3163498616bbe06431fcf195e /test
parent5fe34ffd25c659ec4033e8d0521bc6be41c70b4d (diff)
downloadhdf5-aabfb1d7567ed7b69ec2d4b10bb254aec9cabbc3.zip
hdf5-aabfb1d7567ed7b69ec2d4b10bb254aec9cabbc3.tar.gz
hdf5-aabfb1d7567ed7b69ec2d4b10bb254aec9cabbc3.tar.bz2
[svn-r20934] Issue 4278 - When reading data fails, the error message should say which filter isn't registered. This is the follow-up commit (20929 and 20930). The check-vfd in Makefile has trouble with the file name. Because the test file
is pre-generated, I use the default FAPL to create the full file name to avoid some driver test. Tested on jam - simple change.
Diffstat (limited to 'test')
-rw-r--r--test/error_test.c14
-rw-r--r--test/testfiles/error_test_13
2 files changed, 10 insertions, 7 deletions
diff --git a/test/error_test.c b/test/error_test.c
index aa7dc63..760351d 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -25,7 +25,7 @@
#ifdef H5_USE_16_API
int main(void)
{
- printf("Test skipped because backward compatbility with v1.6 is configured in\n");
+ fprintf(stderr, "Test skipped because backward compatbility with v1.6 is configured in\n");
return 0;
}
#else /* H5_USE_16_API */
@@ -363,7 +363,7 @@ test_long_desc(void)
if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR;
/* Create the string that should be in the description */
- HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc);
+ snprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc);
/* Make certain that the description is correct */
if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR;
@@ -747,18 +747,20 @@ main(void)
if(close_error() < 0)
TEST_ERROR;
- /* Test error message during data reading when filter isn't registered */
- h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ /* Test error message during data reading when filter isn't registered
+ * Use default FAPL to avoid some VFD drivers by the check-vfd test because
+ * the test file was pre-generated. */
+ h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof filename);
if(test_filter_error(filename) < 0)
TEST_ERROR;
h5_cleanup(FILENAME, fapl);
- printf("All error API tests passed.\n");
+ fprintf(stderr, "\nAll error API tests passed.\n");
return 0;
error:
- printf("***** ERROR TEST FAILED! *****\n");
+ fprintf(stderr, "\n***** ERROR TEST FAILED (real problem)! *****\n");
return 1;
}
#endif /* H5_USE_16_API */
diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1
index 5ba1847..8d6e208 100644
--- a/test/testfiles/error_test_1
+++ b/test/testfiles/error_test_1
@@ -1,7 +1,6 @@
#############################
Expected output for error_test
#############################
-All error API tests passed.
This program tests the Error API. There're supposed to be some error messages
********* Print error stack in HDF5 default way *********
Second Test-DIAG: Error detected in Second Program (1.0) thread (IDs):
@@ -57,3 +56,5 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
major: Data filters
minor: Read failed
+
+All error API tests passed.