コード例 #1
0
ファイル: enum.c プロジェクト: MattNapsAlot/rHDF5
/*-------------------------------------------------------------------------
 * Function:	main
 *
 * Purpose:
 *
 * Return:	Success:
 *
 *		Failure:
 *
 * Programmer:	Robb Matzke
 *              Tuesday, December 22, 1998
 *
 * Modifications:
 *
 *-------------------------------------------------------------------------
 */
int
main(void)
{
    hid_t	fapl=-1, file=-1;
    char	name[1024];
    int		nerrors=0;

    h5_reset();
    fapl = h5_fileaccess();

    /* Create the file */
    h5_fixname(FILENAME[0], fapl, name, sizeof name);
    if ((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error;

    /* Tests */
    nerrors += test_named(file);
    nerrors += test_noconv(file);
    nerrors += test_tr1(file);
    nerrors += test_tr2(file);
    nerrors += test_value_dsnt_exist();

  	H5Fclose(file);

    if (nerrors) goto error;
    puts("All enum tests passed.");
    h5_cleanup(FILENAME, fapl);
    return 0;

 error:
    puts("*** ENUM TESTS FAILED ***");
    return 1;
}
コード例 #2
0
ファイル: semtest.c プロジェクト: edgar-pek/PerspicuOS
int
main(void)
{
	test_unnamed();
	test_named();
	return (0);
}
コード例 #3
0
ファイル: testshm.c プロジェクト: kheradmand/Break
int main(void)
{
    apr_status_t rv;
    apr_pool_t *pool;
    char errmsg[200];

    apr_initialize();

    printf("APR Shared Memory Test\n");
    printf("======================\n\n");

    printf("Initializing the pool............................");
    if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {
        printf("could not initialize pool\n");
        exit(-1);
    }
    printf("OK\n");

    rv = test_anon(pool);
    if (rv != APR_SUCCESS) {
        if (rv == APR_ENOTIMPL) {
            printf("Anonymous shared memory unavailable on this platform.\n");
        }
        else {
            printf("Anonymous shared memory test FAILED: [%d] %s\n",
                   rv, apr_strerror(rv, errmsg, sizeof(errmsg)));
            exit(-2);
        }
    }
    printf("Anonymous shared memory test passed!\n");

    if ((rv = test_named(pool)) != APR_SUCCESS) {
        printf("Name-based shared memory test FAILED: [%d] %s \n",
               rv, apr_strerror(rv, errmsg, sizeof(errmsg)));
        exit(-3);
    }
    printf("Named shared memory test passed!\n");

    return 0;
}