* @param context Text context
**/
FunctionalTest::FunctionalTest(deqp::Context& context)
- : TestCase(context, "functional", "Test verifies CopySubImageData copy data as requested")
+ : TestCase(context, "functional", "Test verifies CopyImageSubData copy data as requested")
, m_dst_buf_name(0)
, m_dst_tex_name(0)
, m_rb_name(0)
**/
InvalidTargetTest::InvalidTargetTest(deqp::Context& context)
: TestCase(context, "invalid_target",
- "Test verifies if INVALID_ENUM is generated when invalid target is provided to CopySubImageData")
+ "Test verifies if INVALID_ENUM is generated when invalid target is provided to CopyImageSubData")
, m_dst_buf_name(0)
, m_dst_tex_name(0)
, m_src_buf_name(0)
}
}
-/* TargetMissMatchTest */
+/* TargetMismatchTest */
/** Constructor
*
* @param context Text context
**/
-TargetMissMatchTest::TargetMissMatchTest(deqp::Context& context)
+TargetMismatchTest::TargetMismatchTest(deqp::Context& context)
: TestCase(
context, "target_miss_match",
- "Test verifies if INVALID_ENUM is generated when target provided to CopySubImageData does not match texture")
+ "Test verifies if INVALID_ENUM is generated when target provided to CopyImageSubData does not match texture")
, m_dst_buf_name(0)
, m_dst_tex_name(0)
, m_src_buf_name(0)
*
* @return CONTINUE as long there are more test case, STOP otherwise
**/
-tcu::TestNode::IterateResult TargetMissMatchTest::iterate()
+tcu::TestNode::IterateResult TargetMismatchTest::iterate()
{
GLenum error = GL_NO_ERROR;
const Functions& gl = m_context.getRenderContext().getFunctions();
/** Cleans resources
*
**/
-void TargetMissMatchTest::clean()
+void TargetMismatchTest::clean()
{
const Functions& gl = m_context.getRenderContext().getFunctions();
}
}
-/* TargetMissMatchTest */
+/* TargetMismatchTest */
/** Constructor
*
* @param context Text context
IncompleteTexTest::IncompleteTexTest(deqp::Context& context)
: TestCase(
context, "incomplete_tex",
- "Test verifies if INVALID_OPERATION is generated when texture provided to CopySubImageData is incomplete")
+ "Test verifies if INVALID_OPERATION is generated when texture provided to CopyImageSubData is incomplete")
, m_dst_buf_name(0)
, m_dst_tex_name(0)
, m_src_buf_name(0)
IncompatibleFormatsTest::IncompatibleFormatsTest(deqp::Context& context)
: TestCase(
context, "incompatible_formats",
- "Test verifies if INVALID_OPERATION is generated when textures provided to CopySubImageData are incompatible")
+ "Test verifies if INVALID_OPERATION is generated when textures provided to CopyImageSubData are incompatible")
, m_dst_buf_name(0)
, m_dst_tex_name(0)
, m_src_buf_name(0)
*
* @param context Text context
**/
-SamplesMissMatchTest::SamplesMissMatchTest(deqp::Context& context)
- : TestCase(context, "samples_missmatch", "Test verifies if INVALID_OPERATION is generated when textures provided "
- "to CopySubImageData have different number of samples")
+SamplesMismatchTest::SamplesMismatchTest(deqp::Context& context)
+ : TestCase(context, "samples_mismatch", "Test verifies if INVALID_OPERATION is generated when textures provided "
+ "to CopyImageSubData have different number of samples")
, m_dst_tex_name(0)
, m_src_tex_name(0)
, m_test_case_index(0)
*
* @return CONTINUE as long there are more test case, STOP otherwise
**/
-tcu::TestNode::IterateResult SamplesMissMatchTest::iterate()
+tcu::TestNode::IterateResult SamplesMismatchTest::iterate()
{
GLenum error = GL_NO_ERROR;
const Functions& gl = m_context.getRenderContext().getFunctions();
/** Cleans resources
*
**/
-void SamplesMissMatchTest::clean()
+void SamplesMismatchTest::clean()
{
const Functions& gl = m_context.getRenderContext().getFunctions();
**/
IncompatibleFormatsCompressionTest::IncompatibleFormatsCompressionTest(deqp::Context& context)
: TestCase(context, "incompatible_formats_compression", "Test verifies if INVALID_OPERATION is generated when "
- "textures provided to CopySubImageData are incompatible, "
+ "textures provided to CopyImageSubData are incompatible, "
"one of formats is compressed")
, m_dst_tex_name(0)
, m_src_tex_name(0)
m_src_tex_name = 0;
}
-/* MissMatchObjectTest */
+/* InvalidObjectTest */
/** Constructor
*
* @param context Text context
**/
-MissMatchObjectTest::MissMatchObjectTest(deqp::Context& context)
+InvalidObjectTest::InvalidObjectTest(deqp::Context& context)
: TestCase(
- context, "missmatch_object",
- "Test verifies if INVALID_VALUE is generated when object & target provided to CopySubImageData do not match")
+ context, "invalid_object",
+ "Test verifies if INVALID_VALUE is generated when object & target provided to CopyImageSubData do not match")
, m_dst_name(0)
, m_src_name(0)
, m_test_case_index(0)
{
- static const testCase test_cases[] = { { GL_TEXTURE_2D, GL_TEXTURE_2D, GL_TEXTURE_2D, GL_NO_ERROR },
- { GL_TEXTURE_2D, GL_RENDERBUFFER, GL_TEXTURE_2D, GL_INVALID_VALUE },
- { GL_TEXTURE_2D, GL_TEXTURE_2D, GL_RENDERBUFFER, GL_INVALID_VALUE },
- { GL_TEXTURE_2D, GL_RENDERBUFFER, GL_RENDERBUFFER, GL_INVALID_VALUE },
- { GL_RENDERBUFFER, GL_TEXTURE_2D, GL_TEXTURE_2D, GL_INVALID_VALUE },
- { GL_RENDERBUFFER, GL_RENDERBUFFER, GL_TEXTURE_2D, GL_INVALID_VALUE },
- { GL_RENDERBUFFER, GL_TEXTURE_2D, GL_RENDERBUFFER, GL_INVALID_VALUE },
- { GL_RENDERBUFFER, GL_RENDERBUFFER, GL_RENDERBUFFER, GL_NO_ERROR } };
+ static glw::GLenum arg_types[] = { GL_TEXTURE_2D, GL_RENDERBUFFER };
+ static const GLuint n_arg_types = sizeof(arg_types) / sizeof(arg_types[0]);
- static const GLuint n_test_cases = sizeof(test_cases) / sizeof(testCase);
-
- for (GLuint i = 0; i < n_test_cases; ++i)
+ for (GLuint dst = 0; dst < n_arg_types; dst++)
{
- const testCase& test_case = test_cases[i];
+ for (GLuint src = 0; src < n_arg_types; src++)
+ {
+ for (GLuint dst_valid = 0; dst_valid < 2; dst_valid++)
+ {
+ for (GLuint src_valid = 0; src_valid < 2; src_valid++)
+ {
+ glw::GLenum expected_error = GL_INVALID_VALUE;
+ if (!!src_valid && !!dst_valid)
+ {
+ expected_error = GL_NO_ERROR;
+ }
+ const testCase test_case = { arg_types[dst], !!dst_valid, arg_types[src], !!src_valid,
+ expected_error };
- m_test_cases.push_back(test_case);
+ m_test_cases.push_back(test_case);
+ }
+ }
+ }
}
}
*
* @return CONTINUE as long there are more test case, STOP otherwise
**/
-tcu::TestNode::IterateResult MissMatchObjectTest::iterate()
+tcu::TestNode::IterateResult InvalidObjectTest::iterate()
{
GLenum error = GL_NO_ERROR;
const Functions& gl = m_context.getRenderContext().getFunctions();
try
{
/* Prepare objects */
- if (GL_RENDERBUFFER == test_case.m_obj_target)
+ if (GL_RENDERBUFFER == test_case.m_dst_target)
{
m_dst_name = Utils::prepareRenderBuffer(m_context, GL_RGBA8);
- m_src_name = Utils::prepareRenderBuffer(m_context, GL_RGBA8);
}
else
{
m_dst_name =
- Utils::prepareTex16x16x6(m_context, test_case.m_obj_target, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, temp);
- m_src_name =
- Utils::prepareTex16x16x6(m_context, test_case.m_obj_target, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, temp);
+ Utils::prepareTex16x16x6(m_context, test_case.m_dst_target, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, temp);
/* Make textures complete */
- Utils::makeTextureComplete(m_context, test_case.m_obj_target, m_dst_name, 0 /* base */, 0 /* max */);
- Utils::makeTextureComplete(m_context, test_case.m_obj_target, m_src_name, 0 /* base */, 0 /* max */);
+ Utils::makeTextureComplete(m_context, test_case.m_dst_target, m_dst_name, 0 /* base */, 0 /* max */);
+ }
+
+ if (GL_RENDERBUFFER == test_case.m_src_target)
+ {
+ m_src_name = Utils::prepareRenderBuffer(m_context, GL_RGBA8);
+ }
+ else
+ {
+ m_src_name =
+ Utils::prepareTex16x16x6(m_context, test_case.m_src_target, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, temp);
+
+ /* Make texture complete */
+ Utils::makeTextureComplete(m_context, test_case.m_src_target, m_src_name, 0 /* base */, 0 /* max */);
+ }
+
+ /* If an object is invalid, free it before use to make it invalid */
+ if (!test_case.m_dst_valid)
+ {
+ Utils::deleteTexture(m_context, test_case.m_dst_target, m_dst_name);
+ }
+
+ if (!test_case.m_src_valid)
+ {
+ Utils::deleteTexture(m_context, test_case.m_src_target, m_src_name);
}
}
catch (tcu::Exception& exc)
m_context.getTestContext().getLog()
<< tcu::TestLog::Message << "Failure. Expected result: " << glu::getErrorStr(test_case.m_expected_result)
<< " got: " << glu::getErrorStr(error)
- << ". Object target: " << glu::getTextureTargetStr(test_case.m_obj_target)
- << ". Source target: " << glu::getTextureTargetStr(test_case.m_src_target)
- << ". Destination target: " << glu::getTextureTargetStr(test_case.m_dst_target) << tcu::TestLog::EndMessage;
+ << ". Destination target: " << glu::getTextureTargetStr(test_case.m_dst_target)
+ << ". Destination valid: " << (test_case.m_src_valid ? "true" : "false")
+ << ". Source target: " << glu::getTextureTargetStr(test_case.m_dst_target)
+ << ". Source valid: " << (test_case.m_dst_valid ? "true" : "false") << "." << tcu::TestLog::EndMessage;
m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
}
/** Cleans resources
*
**/
-void MissMatchObjectTest::clean()
+void InvalidObjectTest::clean()
{
const Functions& gl = m_context.getRenderContext().getFunctions();
const testCase& test_case = m_test_cases[m_test_case_index];
/* Clean textures or renderbuffers. Errors ignored */
- if (GL_RENDERBUFFER == test_case.m_obj_target)
+ if (test_case.m_dst_valid)
{
- gl.deleteRenderbuffers(1, &m_dst_name);
- gl.deleteRenderbuffers(1, &m_src_name);
+ if (GL_RENDERBUFFER == test_case.m_dst_target)
+ {
+ gl.deleteRenderbuffers(1, &m_dst_name);
+ }
+ else
+ {
+ gl.deleteTextures(1, &m_dst_name);
+ }
}
- else
+ if (test_case.m_src_valid)
{
- gl.deleteTextures(1, &m_dst_name);
- gl.deleteTextures(1, &m_src_name);
+ if (GL_RENDERBUFFER == test_case.m_src_target)
+ {
+ gl.deleteRenderbuffers(1, &m_src_name);
+ }
+ else
+ {
+ gl.deleteTextures(1, &m_src_name);
+ }
}
m_dst_name = 0;
* @param context Text context
**/
NonExistentMipMapTest::NonExistentMipMapTest(deqp::Context& context)
- : TestCase(context, "non_existent_mipmap", "Test verifies if INVALID_VALUE is generated when CopySubImageData is "
+ : TestCase(context, "non_existent_mipmap", "Test verifies if INVALID_VALUE is generated when CopyImageSubData is "
"executed for mipmap that does not exist")
, m_dst_tex_name(0)
, m_src_tex_name(0)
* @param context Text context
**/
ExceedingBoundariesTest::ExceedingBoundariesTest(deqp::Context& context)
- : TestCase(context, "exceeding_boundaries", "Test verifies if INVALID_VALUE is generated when CopySubImageData is "
+ : TestCase(context, "exceeding_boundaries", "Test verifies if INVALID_VALUE is generated when CopyImageSubData is "
"executed for regions exceeding image boundaries")
, m_dst_tex_name(0)
, m_src_tex_name(0)
* @param context Text context
**/
InvalidAlignmentTest::InvalidAlignmentTest(deqp::Context& context)
- : TestCase(context, "invalid_alignment", "Test verifies if INVALID_VALUE is generated when CopySubImageData is "
+ : TestCase(context, "invalid_alignment", "Test verifies if INVALID_VALUE is generated when CopyImageSubData is "
"executed for regions with invalid alignment")
, m_dst_tex_name(0)
, m_src_tex_name(0)
{
addChild(new CopyImage::FunctionalTest(m_context));
addChild(new CopyImage::IncompleteTexTest(m_context));
- addChild(new CopyImage::MissMatchObjectTest(m_context));
+ addChild(new CopyImage::InvalidObjectTest(m_context));
addChild(new CopyImage::SmokeTest(m_context));
addChild(new CopyImage::InvalidTargetTest(m_context));
- addChild(new CopyImage::TargetMissMatchTest(m_context));
+ addChild(new CopyImage::TargetMismatchTest(m_context));
addChild(new CopyImage::IncompatibleFormatsTest(m_context));
- addChild(new CopyImage::SamplesMissMatchTest(m_context));
+ addChild(new CopyImage::SamplesMismatchTest(m_context));
addChild(new CopyImage::IncompatibleFormatsCompressionTest(m_context));
addChild(new CopyImage::NonExistentMipMapTest(m_context));
addChild(new CopyImage::ExceedingBoundariesTest(m_context));