Esempio n. 1
0
int check_manifest(const Manifest *manifest)
{
    return (check_distribution_array(manifest->distribution_array)
      && check_activation_array(manifest->activation_array)
      && check_snapshots_array(manifest->snapshots_array)
      && check_target_array(manifest->target_array));
}
Esempio n. 2
0
int capture_manifest(gchar *interface, const gchar *target_property, gchar *infrastructure_expr, gchar *profile, const unsigned int max_concurrent_transfers, const int xml)
{
    /* Retrieve an array of all target machines from the infrastructure expression */
    GPtrArray *target_array = create_target_array(infrastructure_expr, xml);

    if(target_array == NULL)
    {
        g_printerr("[coordinator]: Error retrieving targets from infrastructure model!\n");
        return 1;
    }
    else
    {
        int exit_status;

        if(check_target_array(target_array))
        {
            GPtrArray *profile_manifest_target_array = g_ptr_array_new();

            if(resolve_profiles(target_array, interface, target_property, profile, profile_manifest_target_array)
              && retrieve_profiles(interface, profile_manifest_target_array, max_concurrent_transfers))
            {
                print_nix_expression_for_profile_manifest_target_array(profile_manifest_target_array);
                exit_status = 0;
            }
            else
                exit_status = 1;

            /* Cleanup */
            delete_profile_manifest_target_array(profile_manifest_target_array);
        }
        else
            exit_status = 1;

        delete_target_array(target_array);

        /* Return exit status */
        return exit_status;
    }
}
Esempio n. 3
0
/**
 * Do error-check tests for texture targets
 */
static bool
test_target_errors(GLenum target)
{
	GLint width = 64, height = 14, depth = 8;
	const GLsizei levels = 1;
	GLuint tex;
	enum piglit_result pass = true;
	GLenum legalTargets[4];
	unsigned int numTargets, numIllegalTargets;
	GLenum illegalTargets[] = {
		GL_TEXTURE_1D,
		GL_TEXTURE_2D,
		GL_TEXTURE_3D,
		GL_TEXTURE_CUBE_MAP,
		GL_TEXTURE_RECTANGLE,
		GL_TEXTURE_1D_ARRAY,
		GL_TEXTURE_2D_ARRAY,
		GL_TEXTURE_CUBE_MAP_ARRAY,
		GL_TEXTURE_2D_MULTISAMPLE,
		GL_TEXTURE_2D_MULTISAMPLE_ARRAY
	};
	GLsizei texSamples;

	if (piglit_is_extension_supported("GL_ARB_texture_storage_multisample")) {
		numIllegalTargets = ARRAY_SIZE(illegalTargets);
		glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &texSamples);
	} else {
		numIllegalTargets =  ARRAY_SIZE(illegalTargets) -2;
		texSamples = 1;
	}

	glGenTextures(1, &tex);   /* orig tex */
	glBindTexture(target, tex);

	switch (target) {
	case GL_TEXTURE_1D:
		glTexStorage1D(target, levels, GL_RGBA8, width);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY, 0);
		break;
	case GL_TEXTURE_1D_ARRAY:
		glTexStorage2D(target, levels, GL_RGBA8, width, height);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY, 0);
		break;
	case GL_TEXTURE_2D:
		glTexStorage2D(target, levels, GL_RGBA8, width, height);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY, 0);
		break;
	case  GL_TEXTURE_RECTANGLE:
		glTexStorage2D(target, levels, GL_RGBA8, width, height);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_RECTANGLE, 0);
		break;
	case GL_TEXTURE_CUBE_MAP:
		width = height;
		glTexStorage2D(target, levels, GL_RGBA8, width, height);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_CUBE_MAP, GL_TEXTURE_2D,
				    GL_TEXTURE_2D_ARRAY,
				    GL_TEXTURE_CUBE_MAP_ARRAY, 0);
		break;
	case GL_TEXTURE_3D:
		glTexStorage3D(target, levels, GL_RGBA8, width, height, depth);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_3D, 0);
		break;
	case GL_TEXTURE_CUBE_MAP_ARRAY:
	case GL_TEXTURE_2D_ARRAY:
		height = width;
		glTexStorage3D(target, levels, GL_RGBA8, width, height, depth*6);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_CUBE_MAP, GL_TEXTURE_2D,
				    GL_TEXTURE_2D_ARRAY,
				    GL_TEXTURE_CUBE_MAP_ARRAY, 0);
		break;
	case GL_TEXTURE_2D_MULTISAMPLE:
		glTexStorage2DMultisample(target, texSamples, GL_RGBA8,
					  width, height, GL_TRUE);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_2D_MULTISAMPLE,
				    GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0);
		break;
	case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
		glTexStorage3DMultisample(target, texSamples, GL_RGBA8,
					  width, height, depth, GL_TRUE);
		numTargets = update_valid_arrays(legalTargets, illegalTargets,
				    numIllegalTargets,
				    GL_TEXTURE_2D_MULTISAMPLE,
				    GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0);
		break;
	default:
		assert(0);
		numTargets = 0;
		break;
	}

	if (!piglit_check_gl_error(GL_NO_ERROR)) {
		printf("%s Found gl errors prior to testing glTextureView\n",
				   TestName);
		pass = false;
		goto err_out;
	}

	/* ensure TextureView of legal targets  works without gl errors */
	pass = pass && check_target_array(GL_NO_ERROR, numTargets, legalTargets,
					  GL_RG16, tex, levels);
	/* ensure TextureView  of illegal targets returns an error */
	pass = pass && check_target_array(GL_INVALID_OPERATION,
					  numIllegalTargets,
					  illegalTargets,
					  GL_RG16, tex, levels);
err_out:
	glDeleteTextures(1, &tex);

	return pass;
}