Exemple #1
0
/*-------------------------------------------------------------------------
 * Function:	Main function
 *
 * Purpose:	Test direct chunk write function H5DOwrite_chunk
 *
 * Return:	Success:	0
 *
 *		Failure:	1
 *
 * Programmer:  Raymond Lu	
 *              30 November 2012
 *
 *-------------------------------------------------------------------------
 */
int main( void )
{
    hid_t file_id;
    int   nerrors=0;

    /*
     * Create a new file. If file exists its contents will be overwritten.
     */
    if((file_id = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
        goto error;

    /* Test direct chunk write */
#ifdef H5_HAVE_FILTER_DEFLATE
    nerrors += test_direct_chunk_write(file_id);
#endif /* H5_HAVE_FILTER_DEFLATE */
    nerrors += test_skip_compress_write1(file_id);
    nerrors += test_skip_compress_write2(file_id);
    nerrors += test_data_conv(file_id);
    nerrors += test_invalid_parameters(file_id);

    if(H5Fclose(file_id) < 0)
        goto error;

    /* check for errors */
    if (nerrors)
        goto error;

    return 0;

error:
    return 1;
}
Exemple #2
0
static int
test_red(void)
{
	uint32_t num_tests = 0;
	uint32_t num_pass = 0;
	int ret = 0;

	if (test_invalid_parameters() < 0)
		return -1;

	run_tests(func_tests, RTE_DIM(func_tests), &num_tests, &num_pass);
	run_tests(perf_tests, RTE_DIM(perf_tests), &num_tests, &num_pass);

	if (num_pass == num_tests) {
		printf("[total: %u, pass: %u]\n", num_tests, num_pass);
		ret = 0;
	} else {
		printf("[total: %u, pass: %u, fail: %u]\n", num_tests, num_pass, num_tests - num_pass);
		ret = -1;
	}
	return ret;
}
Exemple #3
0
DEF_TEST(Codec_Params, r) {
    test_invalid_parameters(r, "index8.png");
    test_invalid_parameters(r, "mandrill.wbmp");
}