Exemplo n.º 1
0
/*-------------------------------------------------------------------------
 * Function:	main
 *
 * Purpose:	Runs external dataset tests.
 *
 * Return:	Success:	exit(0)
 *
 *		Failure:	exit(non-zero)
 *
 * Programmer:	Robb Matzke
 *              Tuesday, March  3, 1998
 *
 * Modifications:
 *
 *-------------------------------------------------------------------------
 */
int
main (void)
{
    hid_t	fapl=-1;		/*file access properties	*/
    hid_t	file=-1;		/*file for test_1* functions	*/
    char	filename[1024];		/*file name for test_1* funcs	*/
    hid_t	grp=-1;			/*group to emit diagnostics	*/
    int		nerrors=0;		/*number of errors		*/

    h5_reset();
    fapl = h5_fileaccess();
    h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
    if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
    if((grp = H5Gcreate2(file, "emit-diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
    if(H5Gclose(grp) < 0) goto error;

    nerrors += test_1a(file);
    nerrors += test_1b(file);
    nerrors += test_1c(file);
    nerrors += test_1d(file);
    nerrors += test_1e(file);
    nerrors += test_1f(file);
    nerrors += test_1g();
    nerrors += test_1h();
    nerrors += test_2(fapl);
    nerrors += test_3(fapl);
    nerrors += test_4(fapl);

    /* Verify symbol table messages are cached */
    nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);

    if (nerrors>0) goto error;

    if (H5Fclose(file) < 0) goto error;
    puts("All external storage tests passed.");
    if (h5_cleanup(FILENAME, fapl)) {
        remove("extern_1a.raw");
        remove("extern_1b.raw");
        remove("extern_2a.raw");
        remove("extern_2b.raw");
        remove("extern_3a.raw");
        remove("extern_3b.raw");
        remove("extern_4a.raw");
        remove("extern_4b.raw");
    }

    return 0;

error:
    H5E_BEGIN_TRY {
        H5Fclose(file);
        H5Pclose(fapl);
    } H5E_END_TRY;
    nerrors = MAX(1, nerrors);
    printf ("%d TEST%s FAILED.\n", nerrors, 1==nerrors?"":"s");
    return 1;
}
Exemplo n.º 2
0
int main(){

	printf("Pass: 1, Fail: 0\n=============\n");
	printf("\n\nTest 1aBoolean: %u\n=============\n", test_1a_bool());
	printf("\n\nTest 1aInteger: %u\n=============\n", test_1a_int());
	printf("\n\nTest 1b: %u\n=============\n", test_1b());
	printf("\n\nTest 2: %u\n=============\n", test_2());	
	printf("\n\nTest 3: %u\n=============\n", test_3());	
	printf("\n\nTest 4: %u\n=============\n", test_4());
	printf("\n\nTest 5: %u\n=============\n", test_5());
	printf("\n\nTest 6: %u\n=============\n", test_6());	
	printf("\n\nTest 7: %u\n=============\n", test_7());			
	return 0;
}