コード例 #1
0
ファイル: combine.c プロジェクト: chemecse/piglit
/* Test texenv-combine with a single texture unit. */
static bool
run_single_texture_test(const struct test_param test_params[],
			const char *test_name)
{
	assert(num_tex_units == 1);
	setup_colors();

	const int num_tests = count_test_combinations(test_params);

	for (int test = 0; test < num_tests; test += test_stride) {
		/* 0. Setup state */
		reset_machine();
		setup_test_env(test, test_params);

		/* 1. Render with OpenGL */
		glTexCoord2f(0, 0); /* use texcoord (0,0) for all vertices */
		piglit_draw_rect(-1, -1, 2, 2);

		/* 2. Compute expected result */
		float expected[4];
		expected[3] = -1.0f;
		compute_tex_combine(0, machine.frag_color, expected);

		/* 3. Compare rendered result to expected result */
		if (!piglit_probe_pixel_rgba(0, 0, expected)) {
			printf("Single Texture Test %s %d\n", test_name,
			       test);
			print_test_env(test, test_params);
			return false;
		}
	}
	return true;
}
コード例 #2
0
int main (int argc, char * argv[])
{
    int opt;
    char cmd[128];
    int args_processed = 0;
    int pid = -1;


    config_permissions();
    bt_mp_LogMsg("\n:::::::::::::::::::::::::::::::::::::::::::::::::::\n");
    bt_mp_LogMsg(":: Bluedroid test app starting\n");

    if ( HAL_load() < 0 ) {
        perror("HAL failed to initialize, exit\n");
        unlink(PID_FILE);
        exit(0);
    }

    setup_test_env();

    /* Automatically perform the init */
//    bdt_init();

    while(!main_done)
    {
        char line[128];

        /* command prompt */
        bt_mp_LogMsg( ">" );
        fflush(stdout);

        fgets (line, 128, stdin);

        if (line[0]!= '\0')
        {
            /* remove linefeed */
            line[strlen(line)-1] = 0;

            process_cmd(line, 0);
            memset(line, '\0', 128);
        }
    }

    /* FIXME: Commenting this out as for some reason, the application does not exit otherwise*/
    //bdt_cleanup();

    HAL_unload();

    bt_mp_LogMsg(":: Bluedroid test app terminating\n");

    return 0;
}