This change replaces usage of vsnprintf with tcu::TestLog.
Components: OpenGL
VK-GL-CTS issue: 482
Affects:
KHR-GL40.texture_gather.*
KHR-GL44.tessellation_shader.compilation_and_linking_errors.*
KHR-GLES31.core.shader_image_size.*
KHR-GLES31.core.vertex_attrib_binding.*
KHR-GLES31.core.shader_atomic_counters.*
KHR-GLES31.core.shader_storage_buffer_object.*
Change-Id: I1c9395bb11e013b3ff7ab98a37b3fb088da8944a
namespace
{
-static tcu::TestLog* currentLog;
-
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
class SACSubcaseBase : public glcts::SubcaseBase
{
public:
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
return status == GL_TRUE;
}
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
}
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
}
return program;
GLint i;
glGetIntegerv(e, &i);
- Output("%s = %d\n", GLenumToString(e), i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " = " << i << tcu::TestLog::EndMessage;
+
if (i < expected)
{
ok = false;
- Output("%s state is incorrect (GetIntegerv, is: %d, expected: %d)\n", GLenumToString(e), i, expected);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " state is incorrect (GetIntegerv, is: " << i
+ << ", expected: " << expected << ")" << tcu::TestLog::EndMessage;
}
GLint64 i64;
if (i64 < static_cast<GLint64>(expected))
{
ok = false;
- Output("%s state is incorrect (GetInteger64v, is: %d, expected: %d)\n", GLenumToString(e),
- static_cast<GLint>(i64), expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e)
+ << " state is incorrect (GetInteger64v, is: " << static_cast<GLint>(i64)
+ << ", expected: " << expected << ")" << tcu::TestLog::EndMessage;
}
GLfloat f;
if (f < static_cast<GLfloat>(expected))
{
ok = false;
- Output("%s state is incorrect (GetFloatv, is: %f, expected: %d)\n", GLenumToString(e), f, expected);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " state is incorrect (GetFloatv, is: " << f
+ << ", expected: " << expected << ")" << tcu::TestLog::EndMessage;
}
GLboolean b;
if (i != expected)
{
ok = false;
- Output("%s state is incorrect (GetIntegerv, is: %d, expected: %d)\n", GLenumToString(e), i, expected);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " state is incorrect (GetIntegerv, is: " << i
+ << ", expected: " << expected << ")" << tcu::TestLog::EndMessage;
}
GLint64 i64;
if (i64 != static_cast<GLint64>(expected))
{
ok = false;
- Output("%s state is incorrect (GetInteger64v, is: %d, expected: %d)\n", GLenumToString(e),
- static_cast<GLint>(i64), expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e)
+ << " state is incorrect (GetInteger64v, is: " << static_cast<GLint>(i64)
+ << ", expected: " << expected << ")" << tcu::TestLog::EndMessage;
}
GLfloat f;
if (f != static_cast<GLfloat>(expected))
{
ok = false;
- Output("%s state is incorrect (GetFloatv, is: %f, expected: %d)\n", GLenumToString(e), f, expected);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " state is incorrect (GetFloatv, is: " << f
+ << ", expected: " << expected << ")" << tcu::TestLog::EndMessage;
}
GLboolean b;
if (b != (expected ? GL_TRUE : GL_FALSE))
{
ok = false;
- Output("%s state is incorrect (GetBooleanv, is: %d, expected: %d)\n", GLenumToString(e), b,
- expected ? GL_TRUE : GL_FALSE);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " state is incorrect (GetBooleanv, is: " << b
+ << ", expected: " << (expected ? GL_TRUE : GL_FALSE) << ")" << tcu::TestLog::EndMessage;
}
return ok;
if (i != binding)
{
ok = false;
- Output("GL_ATOMIC_COUNTER_BUFFER_BINDING state is incorrect (GetIntegeri_v, is: %d, expected: %d, index: "
- "%u)\n",
- i, binding, index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "GL_ATOMIC_COUNTER_BUFFER_BINDING state is incorrect (GetIntegeri_v, is: " << i
+ << ", expected: " << binding << ", index: " << index << tcu::TestLog::EndMessage;
}
GLint64 i64;
if (i64 != static_cast<GLint64>(binding))
{
ok = false;
- Output("GL_ATOMIC_COUNTER_BUFFER_BINDING state is incorrect (GetInteger64i_v, is: %d, expected: %d, index: "
- "%u)\n",
- static_cast<GLint>(i64), binding, index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_ATOMIC_COUNTER_BUFFER_BINDING state is incorrect (GetInteger64i_v, is: "
+ << static_cast<GLint>(i64) << ", expected: " << binding << ", index: " << index
+ << tcu::TestLog::EndMessage;
}
glGetInteger64i_v(GL_ATOMIC_COUNTER_BUFFER_START, index, &i64);
if (i64 != start)
{
ok = false;
- Output("GL_ATOMIC_COUNTER_BUFFER_START state is incorrect (GetInteger64i_v, is: %d, expected: %d, index: "
- "%u)\n",
- static_cast<GLint>(i64), static_cast<GLint>(start), index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "GL_ATOMIC_COUNTER_BUFFER_START state is incorrect (GetInteger64i_v, is: " << static_cast<GLint>(i64)
+ << ", expected: " << static_cast<GLint>(start) << ", index: " << index << tcu::TestLog::EndMessage;
}
glGetInteger64i_v(GL_ATOMIC_COUNTER_BUFFER_SIZE, index, &i64);
if (i64 != size && i64 != 0)
{
ok = false;
- Output("GL_ATOMIC_COUNTER_BUFFER_SIZE state is incorrect (GetInteger64i_v, is: %d, expected: (%d or 0), "
- "index: %u)\n",
- static_cast<GLint>(i64), static_cast<GLint>(size), index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "GL_ATOMIC_COUNTER_BUFFER_SIZE state is incorrect (GetInteger64i_v, is: " << static_cast<GLint>(i64)
+ << ", expected: (" << static_cast<GLint>(size) << " or 0), index: " << index
+ << tcu::TestLog::EndMessage;
}
return ok;
glGetUniformIndices(prog, 1, &uniform_name, &index);
if (index != uniform_index)
{
- Output("Uniform: %s: Bad index returned by glGetUniformIndices.\n", uniform_name);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name
+ << ": Bad index returned by glGetUniformIndices." << tcu::TestLog::EndMessage;
ok = false;
}
glGetProgramResourceName(prog, GL_UNIFORM, uniform_index, sizeof(name), &length, name);
if (length != uniform_length)
{
- Output("Uniform: %s: Length is %d should be %d.\n", uniform_name, length, uniform_length);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": Length is " << length << " should be "
+ << uniform_length << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniform(prog, uniform_index, sizeof(name), &length, &size, &type, name);
if (strcmp(name, uniform_name))
{
- Output("Uniform: %s: Bad name returned by glGetActiveUniform.\n", uniform_name);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": Bad name returned by glGetActiveUniform."
+ << tcu::TestLog::EndMessage;
ok = false;
}
if (length != uniform_length)
{
- Output("Uniform: %s: Length is %d should be %d.\n", uniform_name, length, uniform_length);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": Length is " << length << " should be "
+ << uniform_length << tcu::TestLog::EndMessage;
ok = false;
}
if (size != uniform_size)
{
- Output("Uniform: %s: Size is %d should be %d.\n", uniform_name, size, uniform_size);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Uniform: " << uniform_name << ": Size is "
+ << size << " should be " << uniform_size << tcu::TestLog::EndMessage;
ok = false;
}
if (type != static_cast<GLenum>(uniform_type))
{
- Output("Uniform: %s: Type is %d should be %d.\n", uniform_name, type, uniform_type);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Uniform: " << uniform_name << ": Type is "
+ << type << " should be " << uniform_type << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_TYPE, ¶m);
if (param != uniform_type)
{
- Output("Uniform: %s: Type is %d should be %d.\n", uniform_name, param, uniform_type);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Uniform: " << uniform_name << ": Type is "
+ << param << " should be " << uniform_type << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_SIZE, ¶m);
if (param != uniform_size)
{
- Output("Uniform: %s: GL_UNIFORM_SIZE is %d should be %d.\n", uniform_name, param, uniform_size);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": GL_UNIFORM_SIZE is " << param
+ << " should be " << uniform_size << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_NAME_LENGTH, ¶m);
if (param != (uniform_length + 1))
{
- Output("Uniform: %s: GL_UNIFORM_NAME_LENGTH is %d should be %d.\n", uniform_name, param,
- uniform_length + 1);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": GL_UNIFORM_NAME_LENGTH is " << param
+ << " should be " << (uniform_length + 1) << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_BLOCK_INDEX, ¶m);
if (param != -1)
{
- Output("Uniform: %s: GL_UNIFORM_BLOCK_INDEX should be -1.\n", uniform_name);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Uniform: " << uniform_name
+ << ": GL_UNIFORM_BLOCK_INDEX should be -1." << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_OFFSET, ¶m);
if (param != uniform_offset)
{
- Output("Uniform: %s: GL_UNIFORM_OFFSET is %d should be %d.\n", uniform_name, param, uniform_offset);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": GL_UNIFORM_OFFSET is " << param
+ << " should be " << uniform_offset << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_ARRAY_STRIDE, ¶m);
if (param != uniform_array_stride)
{
- Output("Uniform: %s: GL_UNIFORM_ARRAY_STRIDE is %d should be %d.\n", uniform_name, param,
- uniform_array_stride);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": GL_UNIFORM_ARRAY_STRIDE is " << param
+ << " should be " << uniform_array_stride << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_MATRIX_STRIDE, ¶m);
if (param != 0)
{
- Output("Uniform: %s: GL_UNIFORM_MATRIX_STRIDE should be 0 is %d.\n", uniform_name, param);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": GL_UNIFORM_MATRIX_STRIDE should be 0 is "
+ << param << tcu::TestLog::EndMessage;
ok = false;
}
glGetActiveUniformsiv(prog, 1, &uniform_index, GL_UNIFORM_IS_ROW_MAJOR, ¶m);
if (param != 0)
{
- Output("Uniform: %s: GL_UNIFORM_IS_ROW_MAJOR should be 0 is %d.\n", uniform_name, param);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Uniform: " << uniform_name << ": GL_UNIFORM_MATRIX_STRIDE should be 0 is "
+ << param << tcu::TestLog::EndMessage;
ok = false;
}
std::sort(values, values + size);
for (GLuint i = 0; i < size; ++i)
{
- Output("%u\n", values[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << values[i] << tcu::TestLog::EndMessage;
if (values[i] != i + min_value)
{
- Output("Counter value is %u should be %u.\n", values[i], i + min_value);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Counter value is " << values[i]
+ << " should be " << i + min_value << tcu::TestLog::EndMessage;
return false;
}
}
std::sort(values.begin(), values.end());
for (GLuint i = 0; i < size; ++i)
{
- Output("%u\n", values[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << values[i] << tcu::TestLog::EndMessage;
if (values[i] != i + min_value)
{
- Output("Counter value is %u should be %u.\n", values[i], i + min_value);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Counter value is " << values[i]
+ << " should be " << i + min_value << tcu::TestLog::EndMessage;
return false;
}
}
GLuint* value = static_cast<GLuint*>(glMapBufferRange(GL_ATOMIC_COUNTER_BUFFER, offset, 4, GL_MAP_READ_BIT));
if (value[0] != expected_value)
{
- Output("Counter value is %u should be %u.\n", value, expected_value);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Counter value is " << value
+ << " should be " << expected_value << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, 0);
return false;
glGetBufferParameteri64v(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_SIZE, &i64);
if (i64 != size_)
{
- Output("BUFFER_SIZE is %d should be %d.\n", static_cast<GLint>(i64), static_cast<GLint>(size_));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BUFFER_SIZE is " << static_cast<GLint>(i64) << " should be "
+ << static_cast<GLint>(size_) << tcu::TestLog::EndMessage;
return ERROR;
}
glGetBufferParameteriv(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_USAGE, &i);
if (i != static_cast<GLint>(usage_))
{
- Output("BUFFER_USAGE is %d should be %d.\n", i, usage_);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "BUFFER_USAGE is " << i << " should be "
+ << usage_ << tcu::TestLog::EndMessage;
return ERROR;
}
if (this->m_context.getContextInfo().isExtensionSupported("GL_OES_mapbuffer"))
glGetBufferParameteriv(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_ACCESS, &i);
if (i != static_cast<GLint>(access_))
{
- Output("BUFFER_ACCESS is %d should be %d.\n", i, access_);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "BUFFER_ACCESS is " << i
+ << " should be " << access_ << tcu::TestLog::EndMessage;
return ERROR;
}
}
else
{
- Output("GL_OES_mapbuffer not supported, skipping GL_BUFFER_ACCESS enum");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_OES_mapbuffer not supported, skipping GL_BUFFER_ACCESS enum"
+ << tcu::TestLog::EndMessage;
}
glGetBufferParameteriv(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_ACCESS_FLAGS, &i);
if (i != access_flags_)
{
- Output("BUFFER_ACCESS_FLAGS is %d should be %d.\n", i, access_flags_);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "BUFFER_ACCESS_FLAGS is " << i
+ << " should be " << access_flags_ << tcu::TestLog::EndMessage;
return ERROR;
}
glGetBufferParameteriv(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_MAPPED, &i);
if (i != mapped_)
{
- Output("BUFFER_MAPPED is %d should be %d.\n", i, mapped_);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "BUFFER_MAPPED is " << i << " should be "
+ << mapped_ << tcu::TestLog::EndMessage;
return ERROR;
}
glGetBufferParameteri64v(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_MAP_OFFSET, &i64);
if (i64 != map_offset_)
{
- Output("BUFFER_MAP_OFFSET is %d should be %d.\n", static_cast<GLint>(i64), static_cast<GLint>(map_offset_));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BUFFER_MAP_OFFSET is " << static_cast<GLint>(i64) << " should be "
+ << static_cast<GLint>(map_offset_) << tcu::TestLog::EndMessage;
return ERROR;
}
glGetBufferParameteri64v(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_MAP_LENGTH, &i64);
if (i64 != map_length_)
{
- Output("BUFFER_MAP_LENGTH is %d should be %d.\n", static_cast<GLint>(i64), static_cast<GLint>(map_length_));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BUFFER_MAP_LENGTH is " << static_cast<GLint>(i64) << " should be "
+ << static_cast<GLint>(map_length_) << tcu::TestLog::EndMessage;
return ERROR;
}
void* ptr;
glGetBufferPointerv(GL_ATOMIC_COUNTER_BUFFER, GL_BUFFER_MAP_POINTER, &ptr);
if (ptr != map_pointer_)
{
- Output("BUFFER_MAP_POINTER is %p should be %p.\n", ptr, map_pointer_);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "BUFFER_MAP_POINTER is " << reinterpret_cast<long>(static_cast<int*>(ptr))
+ << " should be " << reinterpret_cast<long>(static_cast<int*>(map_pointer_)) << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_TESS_CONTROL_SHADER:
- Output("*** Tessellation Control Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Control Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_TESS_EVALUATION_SHADER:
- Output("*** Tessellation Evaluation Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Tessellation Evaluation Shader ***"
+ << tcu::TestLog::EndMessage;
break;
case GL_GEOMETRY_SHADER:
- Output("*** Geometry Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Geometry Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
break;
}
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
// shader info log
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
{
if (data[i] != data[i + 1])
{
- Output("Pair of values should be equal, got: %d, %d\n", data[i], data[i + 1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Pair of values should be equal, got: " << data[i] << ", "
+ << data[i + 1] << tcu::TestLog::EndMessage;
error = ERROR;
}
if (i < 510 && data[i] == data[i + 2])
{
- Output("Too many same values found: %d, index: %d\n", data[i], i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Too many same values found: " << data[i] << ", index: " << i
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
}
{
if (data[i] != i)
{
- Output("data[%u] is: %u should be: %u\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "data[" << i << "] is: " << data[i]
+ << " should be: " << i << tcu::TestLog::EndMessage;
res = ERROR;
}
}
{
if (data[i] != i * 2)
{
- Output("data[%u] is: %u should be: %u\n", i, data[i], i * 2);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "data[" << i << "] is: " << data[i]
+ << " should be: " << i * 2 << tcu::TestLog::EndMessage;
res = ERROR;
}
}
{
if (data[i] != i * 3)
{
- Output("data[%u] is: %u should be: %u\n", i, data[i], i * 3);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "data[" << i << "] is: " << data[i]
+ << " should be: " << i * 3 << tcu::TestLog::EndMessage;
res = ERROR;
}
}
{
GLint bindings;
glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &bindings);
- Output("MAX_ATOMIC_COUNTER_BUFFER_BINDINGS: %d\n", bindings);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "MAX_ATOMIC_COUNTER_BUFFER_BINDINGS: " << bindings << tcu::TestLog::EndMessage;
if (!CheckGetCommands(GL_ATOMIC_COUNTER_BUFFER_BINDING, 0))
return ERROR;
glGetIntegerv(GL_ATOMIC_COUNTER_BUFFER_BINDING, &i);
if (i != 0)
{
- Output("Generic binding point should be 0 after deleting bound buffer object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Generic binding point should be 0 after deleting bound buffer object."
+ << tcu::TestLog::EndMessage;
res = ERROR;
}
for (GLint index = 0; index < bindings; ++index)
glGetIntegeri_v(GL_ATOMIC_COUNTER_BUFFER_BINDING, static_cast<GLuint>(index), &i);
if (i != 0)
{
- Output("Binding point %u should be 0 after deleting bound buffer object.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Binding point " << index
+ << " should be 0 after deleting bound buffer object." << tcu::TestLog::EndMessage;
res = ERROR;
}
}
glGetProgramiv(prog_, GL_ACTIVE_ATOMIC_COUNTER_BUFFERS, reinterpret_cast<GLint*>(&active_buffers));
if (active_buffers != 1)
{
- Output("GL_ACTIVE_ATOMIC_COUNTER_BUFFERS is %u should be %d.\n", active_buffers, 1);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_ACTIVE_ATOMIC_COUNTER_BUFFERS is "
+ << active_buffers << " should be 1." << tcu::TestLog::EndMessage;
return ERROR;
}
glGetProgramiv(prog_, GL_ACTIVE_UNIFORMS, reinterpret_cast<GLint*>(&active_uniforms));
if (active_uniforms != 7)
{
- Output("GL_ACTIVE_UNIFORMS is %u should be %d.\n", active_uniforms, 8);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_ACTIVE_UNIFORMS is " << active_uniforms
+ << " should be 8." << tcu::TestLog::EndMessage;
return ERROR;
}
for (GLuint index = 0; index < active_uniforms; ++index)
data_out = static_cast<Vec4*>(glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, sizeof(Vec4), GL_MAP_READ_BIT));
if (data_out[0].x() != 0.0 || data_out[0].y() != 1.0 || data_out[0].z() != 0.0 || data_out[0].w() != 1.0)
{
- Output("Expected vec4(0, 1, 0, 1) in the buffer, got: %f %f %f %f\n", data_out[0].x(), data_out[0].y(),
- data_out[0].z(), data_out[0].w());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Expected vec4(0, 1, 0, 1) in the buffer, got: " << data_out[0].x() << " "
+ << data_out[0].y() << " " << data_out[0].z() << " " << data_out[0].w() << tcu::TestLog::EndMessage;
error = ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
{
if (data[i].x() != 896)
{
- Output("Counter value is %u should be %u.\n", data[i].x(), 896);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Counter value is " << data[i].x()
+ << " should be 896." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i].x() != 1152)
{
- Output("Counter value is %u should be %u.\n", data[i].x(), 896);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Counter value is " << data[i].x()
+ << " should be 896." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, res, buffer);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("glBindBufferBase should generate INVALID_VALUE when"
- " index is greater than or equal GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindBufferBase should generate INVALID_VALUE when"
+ " index is greater than or equal GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS."
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, res, buffer, 0, 4);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("glBindBufferRange should generate INVALID_VALUE when"
- " index is greater than or equal GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindBufferRange should generate INVALID_VALUE when"
+ " index is greater than or equal GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS."
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, res - 1, buffer, 3, 4);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("glBindBufferRange should generate INVALID_VALUE when"
- " <offset> is not a multiple of four\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindBufferRange should generate INVALID_VALUE when"
+ " <offset> is not a multiple of four"
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
return error;
glLinkProgram(prog_);
if (CheckProgram(prog_))
{
- Output("Link should fail because ac_counter0 and ac_counter2 uses same binding and same offset.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Link should fail because ac_counter0 and ac_counter2 uses same binding and same offset."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
glLinkProgram(prog_);
if (CheckProgram(prog_))
{
- Output("Link should fail because atomic counters cannot be declared in the buffer block.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Link should fail because atomic counters cannot be declared in the buffer block."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
glLinkProgram(prog_);
if (CheckProgram(prog_))
{
- Output("Link should fail because atomic counters cannot be declared in the uniform block.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Link should fail because atomic counters cannot be declared in the uniform block."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
{
if (data[i] != data[i + 1])
{
- Output("Pair of values should be equal, got: %d, %d\n", data[i], data[i + 1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Pair of values should be equal, got: " << data[i] << ", "
+ << data[i + 1] << tcu::TestLog::EndMessage;
error = ERROR;
}
if (i < 510 && data[i] == data[i + 2])
{
- Output("Too many same values found: %d, index: %d\n", data[i], i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Too many same values found: " << data[i] << ", index: " << i
+ << tcu::TestLog::EndMessage;
error = ERROR;
}
}
glGetShaderiv(sh, GL_COMPILE_STATUS, &status_comp);
if (status_comp != GL_TRUE)
{
- Output("Unexpected error during vertex shader compilation.");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Unexpected error during vertex shader compilation."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glDeleteShader(sh);
glGetProgramiv(prog_, GL_LINK_STATUS, &status);
if (status_comp == GL_TRUE && status == GL_TRUE)
{
- Output("Expected error during fragment shader compilation or linking.");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Expected error during fragment shader compilation or linking."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
glLinkProgram(prog_);
if (CheckProgram(prog_))
{
- Output("Link should fail because atomicCounterIncrement cannot be used on array of atomic counters.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Link should fail because atomicCounterIncrement cannot be used on array of atomic counters."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
glLinkProgram(prog_);
if (CheckProgram(prog_))
{
- Output(
- "Link should fail because atomic counters cannot be incremented by standard arithmetic operations.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "Link should fail because atomic counters cannot be incremented by standard arithmetic operations."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
if (data[0] != 100)
{
status = ERROR;
- Output("AC buffer content is %u, sholud be 100.\n", data[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "AC buffer content is " << data[0]
+ << ", sholud be 100." << tcu::TestLog::EndMessage;
}
glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, 0);
if (data[i] != i)
{
status = ERROR;
- Output("data[%u] is %u, should be %u.\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "data[" << i << " is " << data[i]
+ << ", sholud be " << i << tcu::TestLog::EndMessage;
}
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (data[0] != 100)
{
status = ERROR;
- Output("AC buffer content is %u, sholud be 100.\n", data[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "AC buffer content is " << data[0]
+ << ", sholud be 100" << tcu::TestLog::EndMessage;
}
glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, 0);
if (data[i] != i)
{
status = ERROR;
- Output("data[%u] is %u, should be %u.\n", i, data[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "data[" << i << "] is " << data[i]
+ << ", sholud be " << i << tcu::TestLog::EndMessage;
}
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
data = static_cast<GLuint*>(glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, sizeof(GLuint), GL_MAP_READ_BIT));
if (data[0] != 1u)
{
- Output("Expected 1, got: %d", data[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Expected 1, got: " << data[0] << tcu::TestLog::EndMessage;
error = ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
void ShaderAtomicCountersTests::init()
{
using namespace glcts;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-buffer-operations", TestSubcase::Create<BasicBufferOperations>));
addChild(new TestSubcase(m_context, "basic-buffer-state", TestSubcase::Create<BasicBufferState>));
addChild(new TestSubcase(m_context, "basic-buffer-bind", TestSubcase::Create<BasicBufferBind>));
T2DA
};
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
const char* const kGLSLVer = "#version 310 es";
const char* const kGLSLSIA = NL "#extension GL_OES_shader_image_atomic : require";
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[i]).c_str(),
- ToString(expected_value).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value) << tcu::TestLog::EndMessage;
return false;
}
}
{
if (always)
{
- Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[i]).c_str(),
- ToString(expected_value).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value) << tcu::TestLog::EndMessage;
}
}
return true;
fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
{
-
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
- expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y
+ << "). Color is (" << fb[i + 0] / g_color_max[0] << " " << fb[i + 1] / g_color_max[1] << " "
+ << fb[i + 2] / g_color_max[2] << "Color should be (" << expected[0] << " " << expected[1] << " "
+ << expected[2] << ")." << tcu::TestLog::EndMessage;
return false;
}
}
glGetShaderInfoLog(shader, sizeof(log), &length, log);
if (length > 1)
{
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
return false;
}
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
return false;
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
if (!LinkProgram(p))
{
if (src_vs)
- Output("%s%s\n", hvs.c_str(), src_vs);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << kGLSLVer << src_vs << tcu::TestLog::EndMessage;
if (src_fs)
- Output("%s%s\n", hfs.c_str(), src_fs);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << kGLSLVer << src_fs << tcu::TestLog::EndMessage;
return p;
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
if (!LinkProgram(p))
{
if (!cs.empty())
- Output("%s%s\n", hcs.c_str(), cs.c_str());
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << hcs << cs << tcu::TestLog::EndMessage;
return p;
}
{
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n%s\n%s\n%s\n", log, src3[0], src3[1], src3[2]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << src3[0] << "\n"
+ << src3[1] << "\n"
+ << src3[2] << tcu::TestLog::EndMessage;
}
return p;
}
glGetIntegeri_v(GL_IMAGE_BINDING_NAME, unit, &i);
if (static_cast<GLuint>(i) != texture)
{
- Output("GL_IMAGE_BINDING_NAME is %d should be %d.\n", i, texture);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_NAME is " << i
+ << " should be " << texture << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_LEVEL, unit, &i);
if (i != level)
{
- Output("GL_IMAGE_BINDING_LEVEL is %d should be %d.\n", i, level);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LEVEL is " << i
+ << " should be " << level << tcu::TestLog::EndMessage;
return false;
}
glGetBooleani_v(GL_IMAGE_BINDING_LAYERED, unit, &b);
if (i != layered || b != layered)
{
- Output("GL_IMAGE_BINDING_LAYERED is %d should be %d.\n", i, layered);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LAYERED is " << i
+ << " should be " << layered << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_LAYER, unit, &i);
if (i != layer)
{
- Output("GL_IMAGE_BINDING_LAYER is %d should be %d.\n", i, layer);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_LAYER is " << i
+ << " should be " << layer << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_ACCESS, unit, &i);
if (static_cast<GLenum>(i) != access)
{
- Output("GL_IMAGE_BINDING_ACCESS is %d should be %d.\n", i, access);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_ACCESS is " << i
+ << " should be " << access << tcu::TestLog::EndMessage;
return false;
}
glGetIntegeri_v(GL_IMAGE_BINDING_FORMAT, unit, &i);
if (static_cast<GLenum>(i) != format)
{
- Output("GL_IMAGE_BINDING_FORMAT is %d should be %d.\n", i, format);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_IMAGE_BINDING_FORMAT is " << i
+ << " should be " << format << tcu::TestLog::EndMessage;
return false;
}
{
if (!CheckMax(GL_MAX_IMAGE_UNITS, 4))
{
- Output("GL_MAX_IMAGE_UNITS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_IMAGE_UNITS value is invalid." << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, 4))
{
- Output("GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_VERTEX_IMAGE_UNIFORMS, 0))
{
- Output("GL_MAX_VERTEX_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_VERTEX_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_FRAGMENT_IMAGE_UNIFORMS, 0))
{
- Output("GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_FRAGMENT_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_COMBINED_IMAGE_UNIFORMS, 4))
{
- Output("GL_MAX_COMBINED_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_COMBINED_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!CheckMax(GL_MAX_COMPUTE_IMAGE_UNIFORMS, 4))
{
- Output("GL_MAX_COMPUTE_IMAGE_UNIFORMS value is invalid.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_MAX_COMPUTE_IMAGE_UNIFORMS value is invalid."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
{
if (!CheckBinding(index, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI))
{
- Output("Binding point %d has invalid default state.\n", index);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Binding point " << index
+ << " has invalid default state." << tcu::TestLog::EndMessage;
status = false;
}
}
glGetIntegeri_v(GL_IMAGE_BINDING_NAME, index, &name);
if (name != 0)
{
- Output("Binding point %d should be set to 0 after texture deletion.\n", index);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Binding point " << index
+ << " should be set to 0 after texture deletion." << tcu::TestLog::EndMessage;
status = false;
}
if (!CheckBinding(index, 0, 0, GL_FALSE, 0, GL_READ_ONLY, GL_R32UI))
glGetTexParameteriv(GL_TEXTURE_2D, GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, &i);
if (i != GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE)
{
- Output("GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
- "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL.");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
+ "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glGetTexParameterfv(GL_TEXTURE_2D, GL_IMAGE_FORMAT_COMPATIBILITY_TYPE, &f);
if (static_cast<GLenum>(f) != GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE)
{
- Output("GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
- "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL.");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should equal to "
+ "GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE for textures allocated by the GL."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value)
+ << ". Format is: " << FormatEnumToString(internalformat) << ". Unit is: " << unit
+ << tcu::TestLog::EndMessage;
glDeleteTextures(1, &texture);
glUseProgram(0);
glDeleteProgram(program);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value)
+ << ". Format is: " << FormatEnumToString(internalformat) << ". Unit is: " << unit
+ << tcu::TestLog::EndMessage;
glDeleteTextures(1, &texture);
glUseProgram(0);
glDeleteProgram(program);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value)
+ << ". Format is: " << FormatEnumToString(internalformat) << ". Unit is: " << unit
+ << tcu::TestLog::EndMessage;
glUseProgram(0);
glDeleteProgram(program);
glDeleteTextures(1, &texture);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s. Unit is: %d.\n", i,
- ToString(map_data[i]).c_str(), ToString(expected_value).c_str(),
- FormatEnumToString(internalformat).c_str(), unit);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value)
+ << ". Format is: " << FormatEnumToString(internalformat) << ". Unit is: " << unit
+ << tcu::TestLog::EndMessage;
glUseProgram(0);
glDeleteProgram(program);
glDeleteTextures(1, &texture);
{
if (!Equal(map_data[i], expected_value, internalformat))
{
- Output("[%d] Value is: %s. Value should be: %s. Format is: %s.\n", i, ToString(map_data[i]).c_str(),
- ToString(expected_value).c_str(), FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[i])
+ << ". Value should be: " << ToString(expected_value)
+ << ". Format is: " << FormatEnumToString(internalformat) << tcu::TestLog::EndMessage;
glDeleteTextures(2, texture);
glUseProgram(0);
glDeleteProgram(program);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat)
+ << ". format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glDeleteTextures(8, textures);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat)
+ << ". format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glDeleteTextures(8, textures);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat)
+ << ". format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glUseProgram(0);
layers = 6;
status = CompareValues(map_data, kSize, expected_value, internalformat, layers);
if (!status)
- Output("%d target, %s format failed. \n", target, FormatEnumToString(internalformat).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << target << " target, " << FormatEnumToString(internalformat)
+ << ". format failed." << tcu::TestLog::EndMessage;
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
glUseProgram(0);
if (!Equal(out_data[i], ivec4(10, 10, 10, 10), 0))
{
status = false;
- Output("[%d] Atomic operation check failed. (operation/target coded: %s) \n", i,
- ToString(out_data[i]).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i
+ << "] Atomic operation check failed. (operation/target coded: " << ToString(out_data[i]) << ")"
+ << tcu::TestLog::EndMessage;
}
}
if (!Equal(out_data[i], ivec4(0, 1, 0, 1), 0))
{
status = false;
- Output("[%d] load/store operation check failed. (%s) \n", i, ToString(out_data[i]).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] load/store operation check failed. ("
+ << ToString(out_data[i]) << ")" << tcu::TestLog::EndMessage;
}
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (!Equal(out_data[i], ivec4(0, 1, 0, 1), 0))
{
status = false;
- Output("[%d] Atomic operation check failed. (%s) \n", i, ToString(out_data[i]).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Atomic operation check failed. ("
+ << ToString(out_data[i]) << ")" << tcu::TestLog::EndMessage;
}
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (!Equal(out_data[i], ivec4(5, 0, 0, 2), 0))
{
status = false;
- Output("[%d] Check failed. Received: %s instead of: %s \n", i, ToString(out_data[i]).c_str(),
- ToString(ivec4(5, 0, 0, 2)).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Check failed. Received: " << ToString(out_data[i])
+ << " instead of: " << ToString(ivec4(5, 0, 0, 2)) << tcu::TestLog::EndMessage;
}
}
if (!Equal(out_data[i], ivec4(5, 0, 0, 2), 0))
{
status = false;
- Output("[%d] Check failed. Received: %s instead of: %s \n", i, ToString(out_data[i]).c_str(),
- ToString(ivec4(5, 0, 0, 2)).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Check failed. Received: " << ToString(out_data[i])
+ << " instead of: " << ToString(ivec4(5, 0, 0, 2)) << tcu::TestLog::EndMessage;
}
}
if (!Equal(map_data[0], ivec4(0, 1, 0, 1), 0))
{
- Output("[%d] Value is: %s. Value should be: %s.\n", i, ToString(map_data[0]).c_str(),
- ToString(ivec4(0, 1, 0, 1)).c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[" << i << "] Value is: " << ToString(map_data[0])
+ << ". Value should be: " << ToString(ivec4(0, 1, 0, 1)) << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
if (!status)
{
- Output("glUniform* should generate INVALID_OPERATION if the location refers to an image variable.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "glUniform* should generate INVALID_OPERATION if the location refers to an image variable."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
if (!status)
{
- Output(
- "glProgramUniform* should generate INVALID_OPERATION if the location refers to an image variable.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "glProgramUniform* should generate INVALID_OPERATION if the location refers to an image variable."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(max_image_units, m_texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <unit> is greater than or equal to the value of "
- "MAX_IMAGE_UNITS.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "BindImageTexture should generate INVALID_VALUE if <unit> is greater than or equal to the value of "
+ "MAX_IMAGE_UNITS."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(0, 123, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <texture> is not the name of an existing texture "
- "object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "BindImageTexture should generate INVALID_VALUE if <texture> is not the name of an existing texture "
+ "object."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <format> is not a legal format.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "BindImageTexture should generate INVALID_VALUE if <format> is not a legal format."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture, -1, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <level> is less than zero.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "BindImageTexture should generate INVALID_VALUE if <level> is less than zero."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture, 0, GL_FALSE, -1, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("BindImageTexture should generate INVALID_VALUE if <layer> is less than zero.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "BindImageTexture should generate INVALID_VALUE if <layer> is less than zero."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindImageTexture(1, m_texture2, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA32F);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("BindImageTexture should generate INVALID_OPERATION if <texture> is a mutable texture object.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "BindImageTexture should generate INVALID_OPERATION if <texture> is a mutable texture object."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
GLchar log[1024];
glGetShaderInfoLog(sh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Compilation should fail [compute shader].\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail [compute shader]." << tcu::TestLog::EndMessage;
return false;
}
const char* const fsVer = "#version 310 es" NL "precision highp float;";
glCompileShader(fsh);
glGetShaderInfoLog(fsh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
glDeleteShader(fsh);
if (status == GL_TRUE)
{
- Output("Compilation should fail [fragment shader].\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail [fragment shader]." << tcu::TestLog::EndMessage;
return false;
}
if (status == GL_FALSE)
{
glDeleteProgram(p);
- Output("VS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "VS compilation should be ok." << tcu::TestLog::EndMessage;
return false;
}
glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
glDeleteProgram(p);
- Output("FS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "FS compilation should be ok." << tcu::TestLog::EndMessage;
return false;
}
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
glGetProgramiv(p, GL_LINK_STATUS, &status);
glDeleteProgram(p);
if (status == GL_TRUE)
{
- Output("Link operation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
return false;
}
return true;
void ShaderImageLoadStoreTests::init()
{
using namespace glcts;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-api-get", TestSubcase::Create<BasicAPIGet>));
addChild(new TestSubcase(m_context, "basic-api-bind", TestSubcase::Create<BasicAPIBind>));
addChild(new TestSubcase(m_context, "basic-api-barrier", TestSubcase::Create<BasicAPIBarrier>));
typedef tcu::IVec4 ivec4;
typedef tcu::UVec4 uvec4;
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
const char* const kGLSLVer =
"#version 310 es\n" NL "precision highp float;" NL "precision highp int;" NL "precision highp image2D;" NL
"precision highp image3D;" NL "precision highp imageCube;" NL "precision highp image2DArray;" NL
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
break;
}
+
GLint length;
glGetShaderiv(shaders[i], GL_SHADER_SOURCE_LENGTH, &length);
if (length > 0)
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
if (length > 0)
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
return status == GL_TRUE ? true : false;
glGetShaderInfoLog(shader, sizeof(log), &length, log);
if (length > 1)
{
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
return false;
}
glGetProgramInfoLog(program, sizeof(log), &length, log);
if (length > 1)
{
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
}
return false;
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
return p;
}
}
if (!LinkProgram(p))
{
if (!cs.empty())
- Output("%s%s\n", kGLSLVer, cs.c_str());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << kGLSLVer << cs << tcu::TestLog::EndMessage;
return p;
}
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
if (result)
*result = false;
return p;
glShaderSource(sh, 2, src, NULL);
if (!CompileShader(sh))
{
- Output("%s%s\n", src[0], src[1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << src[0] << src[1] << tcu::TestLog::EndMessage;
if (result)
*result = false;
return p;
if (!LinkProgram(p))
{
if (src_vs)
- Output("%s%s\n", kGLSLVer, src_vs);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << kGLSLVer << src_vs << tcu::TestLog::EndMessage;
if (src_fs)
- Output("%s%s\n", kGLSLVer, src_fs);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << kGLSLVer << src_fs << tcu::TestLog::EndMessage;
if (result)
*result = false;
return p;
{
if (!Equal(map_data[i], expected_result[i]))
{
- Output("Returned value is: (%d %d %d %d). Expected value is: (%d %d %d %d). Image unit is: %d.\n",
- map_data[i][0], map_data[i][1], map_data[i][2], map_data[i][3], expected_result[i][0],
- expected_result[i][1], expected_result[i][2], expected_result[i][3], i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Returned value is: (" << map_data[i][0] << " " << map_data[i][1] << " "
+ << map_data[i][2] << " " << map_data[i][3] << "). Expected value is: (" << expected_result[i][0]
+ << " " << expected_result[i][1] << " " << expected_result[i][2] << " " << expected_result[i][3]
+ << "). Image unit is: " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
GLchar log[1024];
glGetShaderInfoLog(sh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Compilation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail." << tcu::TestLog::EndMessage;
return false;
}
return true;
void ShaderImageSizeTests::init()
{
using namespace glcts;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-nonMS-vs-float", TestSubcase::Create<BasicNonMS<vec4, 0> >));
addChild(new TestSubcase(m_context, "basic-nonMS-vs-int", TestSubcase::Create<BasicNonMS<ivec4, 0> >));
addChild(new TestSubcase(m_context, "basic-nonMS-vs-uint", TestSubcase::Create<BasicNonMS<uvec4, 0> >));
bindrangesize
};
-static tcu::TestLog* currentLog;
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
const char* const kGLSLVer = "#version 310 es" NL "precision highp float;" NL "precision highp int;";
class ShaderStorageBufferObjectBase : public glcts::SubcaseBase
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
- break;
- case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
break;
}
GLint length;
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
if (length > 0)
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
status = false;
if (!status)
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, c0[0] / color_max[0], c0[1] / color_max[1], c0[2] / color_max[2], expected[0], expected[1],
- expected[2]);
-
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y << "). Color is ("
+ << c0[0] / color_max[0] << " " << c0[1] / color_max[1] << " " << c0[2] / color_max[2]
+ << "). Color should be (" << expected[0] << " " << expected[1] << " " << expected[2] << ")."
+ << tcu::TestLog::EndMessage;
return status;
}
fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
{
-
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
- expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y
+ << "). Color is (" << fb[0] / g_color_max[0] << " " << fb[1] / g_color_max[1] << " "
+ << fb[2] / g_color_max[2] << "). Color should be (" << expected[0] << " " << expected[1] << " "
+ << expected[2] << ")." << tcu::TestLog::EndMessage;
return false;
}
}
}
if (!status)
{
- Output("Left-bottom quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Left-bottom quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// right-bottom quad
}
if (!status)
{
- Output("right-bottom quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Right-bottom quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// right-top quad
}
if (!status)
{
- Output("right-top quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Right-top quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// left-top quad
}
if (!status)
{
- Output("left-top quad checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Left-top quad checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// middle horizontal line should be black
}
if (!status)
{
- Output("middle horizontal line checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Middle horizontal line checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
// middle vertical line should be black
}
if (!status)
{
- Output("middle vertical line checking failed. Bad pixels: %d", bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Middle vertical line checking failed. Bad pixels: " << bad
+ << tcu::TestLog::EndMessage;
//return status;
}
if (bad_pixels)
*bad_pixels = bad;
- Output("Bad pixels:%d, counted bad:%d\n", bad_pixels == NULL ? 0 : *bad_pixels, bad);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Bad pixels: " << (bad_pixels == NULL ? 0 : *bad_pixels)
+ << ", counted bad: " << bad << tcu::TestLog::EndMessage;
return status;
}
if (!status)
{
- Output("%s is %d should be at least %d.\n", GLenumToString(e), i, static_cast<GLint>(value));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " is " << i << " should be at least "
+ << static_cast<GLint>(value) << tcu::TestLog::EndMessage;
}
}
else
if (!status)
{
- Output("%s is %d should be at most %d.\n", GLenumToString(e), i, static_cast<GLint>(value));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << GLenumToString(e) << " is " << i << " should be at most "
+ << static_cast<GLint>(value) << tcu::TestLog::EndMessage;
}
}
return status;
if (!status)
{
- Output("%s is %d should be %d.\n", GLenumToString(e), i, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e) << " is " << i
+ << " should be " << expected << tcu::TestLog::EndMessage;
}
return status;
}
if (!status)
{
- Output("%s at index %d is %d should be %d.\n", GLenumToString(e), index, i, expected);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << GLenumToString(e) << " at index " << index
+ << " is " << i << " should be " << expected << tcu::TestLog::EndMessage;
}
return status;
}
{
if (in_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], in_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], in_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
else
{
if (data[i] != 7)
{
- Output("uData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 7)
{
- Output("iData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 7)
{
- Output("uData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != 7)
{
- Output("iData at index %d is %d should be %d.\n", i, data[i], 7);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << data[i] << " should be 7." << tcu::TestLog::EndMessage;
return ERROR;
}
}
return ERROR;
if (*u != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *u, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *u
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
return ERROR;
if (*i != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *i, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *i
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
return ERROR;
if (*u != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *u, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *u
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
return ERROR;
if (*i != 16)
{
- Output("Data at offset 0 is %d should be %d.\n", *i, 16);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Data at offset 0 is " << *i
+ << " should be 16." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
{
if (udata[i] != i)
{
- Output("uData at index %d is %d should be %d.\n", i, udata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << udata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (idata[i] != i)
{
- Output("iData at index %d is %d should be %d.\n", i, idata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << idata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (udata[i] != i)
{
- Output("uData at index %d is %d should be %d.\n", i, udata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "uData at index " << i << " is "
+ << udata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (idata[i] != i)
{
- Output("iData at index %d is %d should be %d.\n", i, idata[i], i);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "iData at index " << i << " is "
+ << idata[i] << " should be " << i << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (expected_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], expected_data[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i)
+ << " is " << tcu::toHex(out_data[i]) << " should be "
+ << tcu::toHex(expected_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (expected_data[i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i], expected_data[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i)
+ << " is " << tcu::toHex(out_data[i]) << " should be "
+ << tcu::toHex(expected_data[i]) << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (in_data[j][i] != out_data[i])
{
- Output("Byte at index %3d is %2x should be %2x.\n", static_cast<int>(i), out_data[i],
- in_data[j][i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Byte at index " << static_cast<int>(i) << " is "
+ << tcu::toHex(out_data[i]) << " should be " << tcu::toHex(in_data[j][i])
+ << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (!Equal(expected[i], out_data[i]))
{
- Output("Float at index %3d is %f should be %f.\n", static_cast<int>(i), out_data[i], expected[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Float at index " << static_cast<int>(i) << " is " << out_data[i]
+ << " should be " << expected[i] << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (!Equal(expected[i], out_data[i]))
{
- Output("Float at index %3d is %f should be %f.\n", static_cast<int>(i), out_data[i], expected[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Float at index " << static_cast<int>(i) << " is " << out_data[i]
+ << " should be " << expected[i] << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
out_data[3] != expected[3])
{
- Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
- out_data[3], expected[0], expected[1], expected[2], expected[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[0] << ", " << out_data[1] << ", " << out_data[2]
+ << ", " << out_data[3] << ", but expected: " << expected[0] << ", " << expected[1] << ", "
+ << expected[2] << ", " << expected[3] << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
out_data[3] != expected[3])
{
- Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
- out_data[3], expected[0], expected[1], expected[2], expected[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+ << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+ << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+ << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << tcu::TestLog::EndMessage;
return ERROR;
}
if (out_data[0] != expected[0] || out_data[1] != expected[1] || out_data[2] != expected[2] ||
out_data[3] != expected[3])
{
- Output("Received: %x, %x, %x, %x, but expected: %x, %x, %x, %x\n", out_data[0], out_data[1], out_data[2],
- out_data[3], expected[0], expected[1], expected[2], expected[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << tcu::toHex(out_data[0]) << ", " << tcu::toHex(out_data[1])
+ << ", " << tcu::toHex(out_data[2]) << ", " << tcu::toHex(out_data[3])
+ << ", but expected: " << tcu::toHex(expected[0]) << ", " << tcu::toHex(expected[1]) << ", "
+ << tcu::toHex(expected[2]) << ", " << tcu::toHex(expected[3]) << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
if (out_data[i * 4 + 0] != expected[i * 4 + 0] || out_data[i * 4 + 1] != expected[i * 4 + 1] ||
out_data[i * 4 + 2] != expected[i * 4 + 2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
- out_data[i * 4 + 2], expected[i * 4 + 0], expected[i * 4 + 1], expected[i * 4 + 2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+ << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[i * 4 + 0] << ", "
+ << expected[i * 4 + 1] << ", " << expected[i * 4 + 2] << tcu::TestLog::EndMessage;
status = false;
}
}
if (fabs(out_data[i * 2 + 0] - expected[i * 2 + 0]) > 1e-6 ||
fabs(out_data[i * 2 + 1] - expected[i * 2 + 1]) > 1e-6)
{
- Output("Received: %f, %f, but expected: %f, %f\n", out_data[i * 2 + 0], out_data[i * 2 + 1],
- expected[i * 2 + 0], expected[i * 2 + 1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 2 + 0] << ", " << out_data[i * 2 + 1]
+ << ", but expected: " << expected[i * 2 + 0] << ", " << expected[i * 2 + 1]
+ << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data2[i * 4 + 0] != expected2[i * 4 + 0] || out_data2[i * 4 + 1] != expected2[i * 4 + 1] ||
out_data2[i * 4 + 2] != expected2[i * 4 + 2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data2[i * 4 + 0], out_data2[i * 4 + 1],
- out_data2[i * 4 + 2], expected2[i * 4 + 0], expected2[i * 4 + 1], expected2[i * 4 + 2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data2[i * 4 + 0] << ", " << out_data2[i * 4 + 1]
+ << ", " << out_data2[i * 4 + 2] << ", but expected: " << expected2[i * 4 + 0] << ", "
+ << expected2[i * 4 + 1] << ", " << expected2[i * 4 + 2] << tcu::TestLog::EndMessage;
status = false;
}
}
if (fabs(out_data2[i * 2 + 0] - expected2[i * 2 + 0]) > 1e-6 ||
fabs(out_data2[i * 2 + 1] - expected2[i * 2 + 1]) > 1e-6)
{
- Output("Received: %f, %f, but expected: %f, %f\n", out_data2[i * 2 + 0], out_data2[i * 2 + 1],
- expected2[i * 2 + 0], expected2[i * 2 + 1]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data2[i * 2 + 0] << ", " << out_data2[i * 2 + 1]
+ << ", but expected: " << expected2[i * 2 + 0] << ", " << expected2[i * 2 + 1]
+ << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data[i * 4 + 0] != expected[0] || out_data[i * 4 + 1] != expected[1] ||
out_data[i * 4 + 2] != expected[2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
- out_data[i * 4 + 2], expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+ << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[0] << ", " << expected[1] << ", "
+ << expected[2] << tcu::TestLog::EndMessage;
status = false;
}
}
if (out_data[i * 4 + 0] != expected[0] || out_data[i * 4 + 1] != expected[1] ||
out_data[i * 4 + 2] != expected[2])
{
- Output("Received: %f, %f, %f, but expected: %f, %f, %f\n", out_data[i * 4 + 0], out_data[i * 4 + 1],
- out_data[i * 4 + 2], expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 0] << ", " << out_data[i * 4 + 1]
+ << ", " << out_data[i * 4 + 2] << ", but expected: " << expected[0] << ", " << expected[1] << ", "
+ << expected[2] << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (out_data[i * 4 + 3] != data[i * 4])
{
- Output("Received: %d, but expected: %d -> %d -> %d\n", out_data[i * 4 + 3], data[i * 4],
- out_data[i * 4 + 1], out_data[i * 4 + 2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 3] << ", but expected: " << data[i * 4]
+ << " -> " << out_data[i * 4 + 1] << " -> " << out_data[i * 4 + 2] << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (out_data[i * 4 + 3] != data[i * 4])
{
- Output("Received: %d, but expected: %d\n", out_data[i * 4 + 3], data[i * 4]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Received: " << out_data[i * 4 + 3]
+ << ", but expected: " << data[i * 4] << tcu::TestLog::EndMessage;
status = false;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer2] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer2] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer3] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer3] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer4] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer4] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer5] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer5] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer6] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer6] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer2] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer2] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer3] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer3] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer4] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer4] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer5] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer5] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer6] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer6] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer1] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer1] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
{
if (data[i] != ref_data[i])
{
- Output("[Buffer0] Data at index %d is %d should be %d.\n", i, data[i], ref_data[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "[Buffer0] Data at index " << i << " is " << data[i]
+ << " should be " << ref_data[i] << tcu::TestLog::EndMessage;
return ERROR;
}
}
for (int i = 0; i < kBufs - 1; ++i)
if (dataout[i + 1] != sizes[i])
{
- Output("Array %d length is %d should be %d.\n", i, dataout[i + 1], sizes[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i + 1] << " should be "
+ << sizes[i] << tcu::TestLog::EndMessage;
status = false;
}
if (dataout[0] != sizes[kBufs - 1] - 1)
{
- Output("Array %d length is %d should be %d.\n", kBufs - 1, dataout[0], sizes[kBufs - 1] - 1);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << (kBufs - 1) << " length is " << dataout[0] << " should be "
+ << (sizes[kBufs - 1] - 1) << tcu::TestLog::EndMessage;
status = false;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
sizes[i] -= 2; // space constrained by offset of range size
if ((layout == std140 || layout == std430) && dataout[i] != sizes[i])
{
- Output("Array %d length is %d should be %d.\n", i, dataout[i], sizes[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i] << " should be "
+ << sizes[i] << tcu::TestLog::EndMessage;
status = false;
}
if ((layout == packed || layout == shared) && (dataout[i] > sizes[i]))
{
- Output("Array %d length is %d should be not greater that %d.\n", i, dataout[i], sizes[i]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Array " << i << " length is " << dataout[i]
+ << " should be not greater that " << sizes[i] << tcu::TestLog::EndMessage;
status = false;
}
}
int i = (sizes[4] - 2) * columns[etype][4] * scalars[etype][4];
if (dataout[i] != 82)
{
- Output("Array 4 index %d is %d should be 82.\n", i, dataout[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Array 4 index " << i << " is "
+ << dataout[i] << " should be 82" << tcu::TestLog::EndMessage;
status = false;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
i = (sizes[6] - 2) * columns[etype][6] * scalars[etype][6];
if (dataout[i] != 82)
{
- Output("Array 6 index %d is %d should be 82.\n", i, dataout[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Array 6 index " << i << " is "
+ << dataout[i] << " should be 82" << tcu::TestLog::EndMessage;
status = false;
}
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
{
if (out_data[i] != expected[i])
{
- Output("Received: %f, but expected: %f\n", out_data[i], expected[i]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Received: " << out_data[i]
+ << ", but expected: " << expected[i] << tcu::TestLog::EndMessage;
status = false;
}
}
GLint alignment;
GLuint buffer;
glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &bindings);
- Output("Max storage buffer bindings %d\n", bindings);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Max storage buffer bindings " << bindings << tcu::TestLog::EndMessage;
glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &alignment);
- Output("Storage buffer offset alignment %d\n", alignment);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Storage buffer offset alignment " << alignment << tcu::TestLog::EndMessage;
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, bindings, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by BindBufferBase if <target> is\n"
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE is generated by BindBufferBase if <target> is\n"
"SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
- "MAX_SHADER_STORAGE_BUFFER_BINDINGS.\n");
+ "MAX_SHADER_STORAGE_BUFFER_BINDINGS."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindBufferRange(GL_SHADER_STORAGE_BUFFER, bindings, 0, 0, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by BindBufferRange if <target> is\n"
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE is generated by BindBufferRange if <target> is\n"
"SHADER_STORAGE_BUFFER and <index> is greater than or equal to the value of\n"
- "MAX_SHADER_STORAGE_BUFFER_BINDINGS.\n");
+ "MAX_SHADER_STORAGE_BUFFER_BINDINGS."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, buffer, alignment - 1, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE is generated by BindBufferRange if <target> is\n"
- "SHADER_STORAGE_BUFFER and <offset> is not a multiple of the value of\n"
- "SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE is generated by BindBufferRange if <target> is\n"
+ "SHADER_STORAGE_BUFFER and <offset> is not a multiple of the value of\n"
+ "SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
GLchar log[1024];
glGetShaderInfoLog(sh, sizeof(log), NULL, log);
- Output("Shader Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Shader Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Compilation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation should fail." << tcu::TestLog::EndMessage;
return false;
}
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
- Output("VS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "VS compilation should be ok." << tcu::TestLog::EndMessage;
CheckProgram(p);
glDeleteProgram(p);
return false;
glGetShaderiv(sh, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
- Output("FS compilation should be ok.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "FS compilation should be ok." << tcu::TestLog::EndMessage;
CheckProgram(p);
glDeleteProgram(p);
return false;
GLchar log[1024];
glGetProgramInfoLog(p, sizeof(log), NULL, log);
- Output("Program Info Log:\n%s\n", log);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "Program Info Log:\n"
+ << log << tcu::TestLog::EndMessage;
GLint status;
glGetProgramiv(p, GL_LINK_STATUS, &status);
if (status == GL_TRUE)
{
- Output("Link operation should fail.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Link operation should fail." << tcu::TestLog::EndMessage;
return false;
}
void ShaderStorageBufferObjectTests::init()
{
using namespace glcts;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-basic-vs", TestSubcase::Create<BasicBasicVS>));
addChild(new TestSubcase(m_context, "basic-basic-cs", TestSubcase::Create<BasicBasicCS>));
addChild(new TestSubcase(m_context, "basic-max", TestSubcase::Create<BasicMax>));
namespace
{
-static tcu::TestLog* currentLog;
-
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
class TGBase : public glcts::SubcaseBase
{
public:
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_COMPUTE_SHADER:
- Output("*** Compute Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Compute Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
- break;
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
}
GLint res;
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
if (data[0] != 0 || data[1] != 255 || data[2] != 0 || data[3] != 255)
{
- Output("Expected Vec4(0, 255, 0, 255), got: %d, %d, %d, %d", data[0], data[1], data[2], data[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Expected Vec4(0, 255, 0, 255), got: " << data[0] << ", " << data[1] << ", "
+ << data[2] << ", " << data[3] << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
data = static_cast<Vec4*>(glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, sizeof(Vec4), GL_MAP_READ_BIT));
if (data[0] != Vec4(0, 1, 0, 1))
{
- Output("Expected Vec4(0, 1, 0, 1), got: %f, %f, %f, %f", data[0].x(), data[0].y(), data[0].z(),
- data[0].w());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Expected Vec4(0, 1, 0, 1), got: " << data[0].x() << ", " << data[0].y()
+ << ", " << data[0].z() << ", " << data[0].w() << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
Vec4 rvec(rdata[0], rdata[1], rdata[2], rdata[3]);
if (rvec != Vec4(0.75))
{
- Output("Got: %f %f %f %f, expected vec4(0.75)", rvec.x(), rvec.y(), rvec.z(), rvec.w());
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Got: " << rvec.x() << " " << rvec.y() << " " << rvec.z() << " "
+ << rvec.w() << ", expected vec4(0.75)" << tcu::TestLog::EndMessage;
return ERROR;
}
}
void TextureGatherTests::init()
{
using namespace glcts;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "api-enums", TestSubcase::Create<GatherEnumsTest>));
addChild(new TestSubcase(m_context, "gather-glsl-compile", TestSubcase::Create<GatherGLSLCompile>));
addChild(new TestSubcase(m_context, "plain-gather-float-2d", TestSubcase::Create<PlainGatherFloat2D>));
namespace
{
-static tcu::TestLog* currentLog;
-
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
class VertexAttribBindingBase : public glcts::SubcaseBase
{
virtual std::string Title()
switch (type)
{
case GL_VERTEX_SHADER:
- Output("*** Vertex Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Vertex Shader ***" << tcu::TestLog::EndMessage;
break;
case GL_FRAGMENT_SHADER:
- Output("*** Fragment Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Fragment Shader ***" << tcu::TestLog::EndMessage;
break;
default:
- Output("*** Unknown Shader ***\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "*** Unknown Shader ***" << tcu::TestLog::EndMessage;
break;
}
GLint length;
{
std::vector<GLchar> source(length);
glGetShaderSource(shaders[i], length, NULL, &source[0]);
- Output("%s\n", &source[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &source[0] << tcu::TestLog::EndMessage;
}
glGetShaderiv(shaders[i], GL_INFO_LOG_LENGTH, &length);
if (length > 0)
{
std::vector<GLchar> log(length);
glGetShaderInfoLog(shaders[i], length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
}
{
std::vector<GLchar> log(length);
glGetProgramInfoLog(program, length, NULL, &log[0]);
- Output("%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << &log[0] << tcu::TestLog::EndMessage;
}
}
return status == GL_TRUE ? true : false;
fabs(fb[i + 1] / g_color_max[1] - expected[1]) > g_color_eps[1] ||
fabs(fb[i + 2] / g_color_max[2] - expected[2]) > g_color_eps[2])
{
-
- Output("Incorrect framebuffer color at pixel (%d %d). Color is (%f %f %f). "
- "Color should be (%f %f %f).\n",
- x, y, fb[i + 0] / g_color_max[0], fb[i + 1] / g_color_max[1], fb[i + 2] / g_color_max[2],
- expected[0], expected[1], expected[2]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Incorrect framebuffer color at pixel (" << x << " " << y
+ << "). Color is (" << fb[i + 0] / g_color_max[0] << " " << fb[i + 1] / g_color_max[1] << " "
+ << fb[i + 2] / g_color_max[2] << ". Color should be (" << expected[0] << " " << expected[1]
+ << " " << expected[2] << ")." << tcu::TestLog::EndMessage;
return false;
}
}
{
if (!ColorEqual(expected_data[i], data[i], Vec4(0.01f)))
{
- Output("Data is: %f %f %f %f, data should be: %f %f %f %f, index is: %d.\n", data[i][0], data[i][1],
- data[i][2], data[i][3], expected_data[i][0], expected_data[i][1], expected_data[i][2],
- expected_data[i][3], i);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is: " << data[i][0] << " " << data[i][1] << " " << data[i][2]
+ << " " << data[i][3] << ", data should be: " << expected_data[i][0] << " " << expected_data[i][1]
+ << " " << expected_data[i][2] << " " << expected_data[i][3] << ", index is: " << i
+ << tcu::TestLog::EndMessage;
status = ERROR;
break;
}
{
if (!IsEqual(expected_datai[i * 8 + j], datai[i * 15 + j]))
{
- Output("Datai is: %d %d %d %d, datai should be: %d %d %d %d, index is: %d.\n", datai[i * 15 + j][0],
- datai[i * 15 + j][1], datai[i * 15 + j][2], datai[i * 15 + j][3],
- expected_datai[i * 8 + j][0], expected_datai[i * 8 + j][1], expected_datai[i * 8 + j][2],
- expected_datai[i * 8 + j][3], i * 8 + j);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Datai is: " << datai[i * 15 + j][0] << " " << datai[i * 15 + j][1]
+ << " " << datai[i * 15 + j][2] << " " << datai[i * 15 + j][3]
+ << ", data should be: " << expected_datai[i * 8 + j][0] << " " << expected_datai[i * 8 + j][1]
+ << " " << expected_datai[i * 8 + j][2] << " " << expected_datai[i * 8 + j][3]
+ << ", index is: " << i * 8 + j << tcu::TestLog::EndMessage;
return ERROR;
}
if (j != 7 && !IsEqual(expected_dataui[i * 8 + j], dataui[i * 15 + j]))
{
- Output("Dataui is: %u %u %u %u, dataui should be: %u %u %u %u, index is: %d.\n",
- dataui[i * 15 + j][0], dataui[i * 15 + j][1], dataui[i * 15 + j][2], dataui[i * 15 + j][3],
- expected_dataui[i * 8 + j][0], expected_dataui[i * 8 + j][1], expected_dataui[i * 8 + j][2],
- expected_dataui[i * 8 + j][3], i * 8 + j);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Dataui is: " << dataui[i * 15 + j][0] << " "
+ << dataui[i * 15 + j][1] << " " << dataui[i * 15 + j][2] << " " << dataui[i * 15 + j][3]
+ << ", data should be: " << expected_datai[i * 8 + j][0] << " " << expected_datai[i * 8 + j][1]
+ << " " << expected_datai[i * 8 + j][2] << " " << expected_datai[i * 8 + j][3]
+ << ", index is: " << i * 8 + j << tcu::TestLog::EndMessage;
return ERROR;
}
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &p);
if (p != array_enabled)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_ENABLED(%d) is %d should be %d.\n", index, p, array_enabled);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_ENABLED(" << index << ") is " << p << " should be "
+ << array_enabled << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_SIZE, &p);
if (p != array_size)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_SIZE(%d) is %d should be %d.\n", index, p, array_size);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_SIZE(" << index << ") is " << p << " should be "
+ << array_size << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &p);
if (p != array_stride)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_STRIDE(%d) is %d should be %d.\n", index, p, array_stride);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_STRIDE(" << index << ") is " << p << " should be "
+ << array_stride << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_TYPE, &p);
if (p != array_type)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_TYPE(%d) is 0x%x should be 0x%x.\n", index, p, array_type);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_TYPE(" << index << ") is " << tcu::toHex(p)
+ << " should be " << tcu::toHex(array_type) << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &p);
if (p != array_normalized)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_NORMALIZED(%d) is %d should be %d.\n", index, p, array_normalized);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED(" << index << ") is " << p
+ << " should be " << array_normalized << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_INTEGER, &p);
if (p != array_integer)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_INTEGER(%d) is %d should be %d.\n", index, p, array_integer);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_INTEGER(" << index << ") is " << p << " should be "
+ << array_integer << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_DIVISOR, &p);
if (p != array_divisor)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_DIVISOR(%d) is %d should be %d.\n", index, p, array_divisor);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_DIVISOR(" << index << ") is " << p << " should be "
+ << array_divisor << tcu::TestLog::EndMessage;
status = false;
}
void* pp;
glGetVertexAttribPointerv(index, GL_VERTEX_ATTRIB_ARRAY_POINTER, &pp);
if (reinterpret_cast<deUintptr>(pp) != array_pointer)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_POINTER(%d) is %p should be %p.\n", index, pp,
- reinterpret_cast<void*>(array_pointer));
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_POINTER(" << index << ") is " << pp << " should be "
+ << reinterpret_cast<void*>(array_pointer) << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &p);
if (p != array_buffer_binding)
{
- Output("GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING(%d) is %d should be %d.\n", index, p, array_buffer_binding);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING(" << index << ") is " << p
+ << " should be " << array_buffer_binding << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_BINDING, &p);
if (static_cast<GLint>(binding) != p)
{
- Output("GL_VERTEX_ATTRIB_BINDING(%d) is %d should be %d.\n", index, p, binding);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_BINDING(" << index
+ << ") is " << p << " should be " << binding << tcu::TestLog::EndMessage;
status = false;
}
glGetVertexAttribiv(index, GL_VERTEX_ATTRIB_RELATIVE_OFFSET, &p);
if (p != relative_offset)
{
- Output("GL_VERTEX_ATTRIB_RELATIVE_OFFSET(%d) is %d should be %d.\n", index, p, relative_offset);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_ATTRIB_RELATIVE_OFFSET(" << index << ") is " << p
+ << " should be " << relative_offset << tcu::TestLog::EndMessage;
status = false;
}
return status;
glGetIntegeri_v(GL_VERTEX_BINDING_BUFFER, index, &p);
if (p != buffer)
{
- Output("GL_VERTEX_BINDING_BUFFER(%d) is %d should be %d.\n", index, p, buffer);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_VERTEX_BINDING_BUFFER(" << index
+ << ") is " << p << " should be " << buffer << tcu::TestLog::EndMessage;
status = false;
}
GLint64 p64;
glGetInteger64i_v(GL_VERTEX_BINDING_OFFSET, index, &p64);
if (p64 != offset)
{
- Output("GL_VERTEX_BINDING_OFFSET(%d) is %ld should be %ld.\n", index, p64, offset);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "GL_VERTEX_BINDING_OFFSET(" << index << ") is " << p64 << " should be "
+ << offset << tcu::TestLog::EndMessage;
status = false;
}
glGetIntegeri_v(GL_VERTEX_BINDING_STRIDE, index, &p);
if (p != stride)
{
- Output("GL_VERTEX_BINDING_STRIDE(%d) is %d should be %d.\n", index, p, stride);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_VERTEX_BINDING_STRIDE(" << index
+ << ") is " << p << " should be " << stride << tcu::TestLog::EndMessage;
status = false;
}
glGetIntegeri_v(GL_VERTEX_BINDING_DIVISOR, index, &p);
if (p != divisor)
{
- Output("GL_VERTEX_BINDING_DIVISOR(%d) is %d should be %d.\n", index, p, divisor);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_VERTEX_BINDING_DIVISOR(" << index
+ << ") is " << p << " should be " << divisor << tcu::TestLog::EndMessage;
status = false;
}
return status;
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &p);
if (p < 16)
{
- Output("GL_MAX_VERTEX_ATTRIB_BINDINGS is %d but must be at least 16.\n", p);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_MAX_VERTEX_ATTRIB_BINDINGS is" << p
+ << "but must be at least 16." << tcu::TestLog::EndMessage;
status = false;
}
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, &p);
if (p < 2047)
{
- Output("GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET is %d but must be at least 2047.\n", p);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET is"
+ << p << "but must be at least 2047." << tcu::TestLog::EndMessage;
status = false;
}
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_STRIDE, &p);
if (p < 2048)
{
- Output("GL_MAX_VERTEX_ATTRIB_STRIDE is %d but must be at least 2048.\n", p);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_MAX_VERTEX_ATTRIB_STRIDE is" << p
+ << "but must be at least 2048." << tcu::TestLog::EndMessage;
status = false;
}
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &p);
if (0 != p)
{
- Output("GL_ELEMENT_ARRAY_BUFFER_BINDING is %d should be %d.\n", p, 0);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "GL_ELEMENT_ARRAY_BUFFER_BINDING is" << p
+ << "should be 0." << tcu::TestLog::EndMessage;
status = false;
}
for (GLuint i = 0; i < 16; ++i)
}
if (!status)
{
- Output("Default state check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Default state check failed." << tcu::TestLog::EndMessage;
status = false;
}
glVertexAttribFormat(0, 2, GL_BYTE, GL_TRUE, 16);
if (!va0.stateVerify() || !vb0.stateVerify())
{
- Output("glVertexAttribFormat state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribFormat state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
glVertexAttribIFormat(2, 3, GL_INT, 512);
if (!va2.stateVerify() || !vb2.stateVerify())
{
- Output("glVertexAttribIFormat state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribIFormat state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
glBindVertexBuffer(0, m_vbo[0], 2048, 128);
if (!va0.stateVerify() || !vb0.stateVerify())
{
- Output("glBindVertexBuffer state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindVertexBuffer state change check failed." << tcu::TestLog::EndMessage;
status = false;
}
glBindVertexBuffer(2, m_vbo[2], 64, 256);
if (!va2.stateVerify() || !vb2.stateVerify())
{
- Output("glBindVertexBuffer state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindVertexBuffer state change check failed." << tcu::TestLog::EndMessage;
status = false;
}
va2.array_buffer_binding = m_vbo[0];
if (!va0.stateVerify() || !vb0.stateVerify() || !va2.stateVerify() || !vb2.stateVerify())
{
- Output("glVertexAttribBinding state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribBinding state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
va0.array_buffer_binding = 0;
if (!va0.stateVerify() || !vb0.stateVerify() || !va15.stateVerify() || !vb15.stateVerify())
{
- Output("glVertexAttribBinding state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribBinding state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
vb15.stride = 32;
if (!va0.stateVerify() || !vb0.stateVerify() || !va15.stateVerify() || !vb15.stateVerify())
{
- Output("glBindVertexBuffer state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindVertexBuffer state change check failed." << tcu::TestLog::EndMessage;
status = false;
}
if (!va0.stateVerify() || !vb0.stateVerify() || !va2.stateVerify() || !vb2.stateVerify() ||
!va15.stateVerify() || !vb15.stateVerify())
{
- Output("glVertexAttribFormat state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribFormat state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
if (!va0.stateVerify() || !vb0.stateVerify() || !va2.stateVerify() || !vb2.stateVerify() ||
!va15.stateVerify() || !vb15.stateVerify())
{
- Output("glVertexAttribPointer state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribPointer state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
if (!va0.stateVerify() || !vb0.stateVerify() || !va2.stateVerify() || !vb2.stateVerify() ||
!va15.stateVerify() || !vb15.stateVerify())
{
- Output("glBindVertexBuffer state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glBindVertexBuffer state change check failed." << tcu::TestLog::EndMessage;
status = false;
}
vb.divisor = i + 7;
if (!va.stateVerify() || !vb.stateVerify())
{
- Output("glVertexAttribDivisor state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribDivisor state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
}
vb.divisor = i;
if (!va.stateVerify() || !vb.stateVerify())
{
- Output("glVertexBindingDivisor state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexBindingDivisor state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
}
va2.binding = 5;
if (!va5.stateVerify() || !vb5.stateVerify() || !va2.stateVerify() || !vb2.stateVerify())
{
- Output("glVertexAttribBinding state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribBinding state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
vb2.divisor = 23;
if (!va5.stateVerify() || !vb5.stateVerify() || !va2.stateVerify() || !vb2.stateVerify())
{
- Output("glVertexAttribDivisor state change check failed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "glVertexAttribDivisor state change check failed."
+ << tcu::TestLog::EndMessage;
status = false;
}
static_cast<IVec4*>(glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(IVec4), GL_MAP_READ_BIT));
if (!IsEqual(*data, IVec4(10)))
{
- Output("Data is: %d %d %d %d, data should be: 10 10 10 10.\n", (*data)[0], (*data)[1], (*data)[2],
- (*data)[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is: " << (*data)[0] << " " << (*data)[1] << " " << (*data)[2]
+ << " " << (*data)[3] << ", data should be: 10 10 10 10." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER);
static_cast<IVec4*>(glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(IVec4), GL_MAP_READ_BIT));
if (!IsEqual(*data, IVec4(20)))
{
- Output("Data is: %d %d %d %d, data should be: 20 20 20 20.\n", (*data)[0], (*data)[1], (*data)[2],
- (*data)[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is: " << (*data)[0] << " " << (*data)[1] << " " << (*data)[2]
+ << " " << (*data)[3] << ", data should be: 20 20 20 20." << tcu::TestLog::EndMessage;
return ERROR;
}
glUnmapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER);
static_cast<IVec4*>(glMapBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, sizeof(IVec4), GL_MAP_READ_BIT));
if (!IsEqual(*data, IVec4(30)))
{
- Output("Data is: %d %d %d %d, data should be: 30 30 30 30.\n", (*data)[0], (*data)[1], (*data)[2],
- (*data)[3]);
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Data is: " << (*data)[0] << " " << (*data)[1] << " " << (*data)[2]
+ << " " << (*data)[3] << ", data should be: 30 30 30 30." << tcu::TestLog::EndMessage;
return ERROR;
}
}
glBindVertexBuffer(0, 1234, 0, 12);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (buffer name not genned).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION should be generated (buffer name not genned)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexBuffer(p + 1, m_vbo, 0, 12);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (bindingIndex greater than GL_MAX_VERTEX_ATTRIB_BINDINGS).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (bindingIndex greater than GL_MAX_VERTEX_ATTRIB_BINDINGS)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexBuffer(0, m_vbo, -10, 12);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (negative offset).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (negative offset)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexBuffer(0, m_vbo, 0, -12);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (negative stride).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (negative stride)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexBuffer(0, m_vbo, 0, p + 4);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (stride greater than GL_MAX_VERTEX_ATTRIB_STRIDE).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (stride greater than GL_MAX_VERTEX_ATTRIB_STRIDE)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexBuffer(0, m_vbo, 0, 12);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (default VAO).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION should be generated (default VAO)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribFormat(p + 1, 4, GL_FLOAT, GL_FALSE, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (attribindex greater than GL_MAX_VERTEX_ATTRIBS).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (attribindex greater than GL_MAX_VERTEX_ATTRIBS)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribIFormat(p + 2, 4, GL_INT, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (attribindex greater than GL_MAX_VERTEX_ATTRIBS).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (attribindex greater than GL_MAX_VERTEX_ATTRIBS)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribFormat(0, 0, GL_FLOAT, GL_FALSE, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (invalid number of components).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (invalid number of components)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribFormat(0, 5, GL_FLOAT, GL_FALSE, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (invalid number of components).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (invalid number of components)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribIFormat(0, 5, GL_INT, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (invalid number of components).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (invalid number of components)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribFormat(0, 4, GL_R32F, GL_FALSE, 0);
if (glGetError() != GL_INVALID_ENUM)
{
- Output("INVALID_ENUM should be generated (invalid type).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_ENUM should be generated (invalid type)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribIFormat(0, 4, GL_FLOAT, 0);
if (glGetError() != GL_INVALID_ENUM)
{
- Output("INVALID_ENUM should be generated (invalid type).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_ENUM should be generated (invalid type)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribFormat(0, 3, GL_INT_2_10_10_10_REV, GL_FALSE, 0);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (invalid number of components for packed type).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_OPERATION should be generated (invalid number of components for packed type)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, &p);
glVertexAttribFormat(0, 4, GL_FLOAT, GL_FALSE, p + 10);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (relativeoffset greater than "
- "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (relativeoffset greater than "
+ "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribIFormat(0, 4, GL_INT, p + 10);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (relativeoffset greater than "
- "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_VALUE should be generated (relativeoffset greater than "
+ "GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexArray(0);
glVertexAttribFormat(0, 4, GL_FLOAT, GL_FALSE, 0);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (default VAO).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION should be generated (default VAO)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glVertexAttribIFormat(0, 4, GL_INT, 0);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (default VAO).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION should be generated (default VAO)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
glVertexAttribBinding(p + 1, 0);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (attribindex greater than GL_MAX_VERTEX_ATTRIBS).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (attribindex greater than GL_MAX_VERTEX_ATTRIBS)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &p);
glVertexAttribBinding(0, p + 1);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (bindingIndex greater than GL_MAX_VERTEX_ATTRIB_BINDINGS).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (bindingIndex greater than GL_MAX_VERTEX_ATTRIB_BINDINGS)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexArray(0);
glVertexAttribBinding(0, 0);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (default VAO).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION should be generated (default VAO)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
glVertexBindingDivisor(p + 1, 1);
if (glGetError() != GL_INVALID_VALUE)
{
- Output("INVALID_VALUE should be generated (bindingIndex greater than GL_MAX_VERTEX_ATTRIBS).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message
+ << "INVALID_VALUE should be generated (bindingIndex greater than GL_MAX_VERTEX_ATTRIBS)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
glBindVertexArray(0);
glVertexBindingDivisor(0, 1);
if (glGetError() != GL_INVALID_OPERATION)
{
- Output("INVALID_OPERATION should be generated (default VAO).\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "INVALID_OPERATION should be generated (default VAO)."
+ << tcu::TestLog::EndMessage;
return ERROR;
}
return NO_ERROR;
void VertexAttribBindingTests::init()
{
using namespace glcts;
- setOutput(m_context.getTestContext().getLog());
addChild(new TestSubcase(m_context, "basic-usage", TestSubcase::Create<BasicUsage>));
addChild(new TestSubcase(m_context, "basic-input-case1", TestSubcase::Create<BasicInputCase1>));
addChild(new TestSubcase(m_context, "basic-input-case2", TestSubcase::Create<BasicInputCase2>));
namespace glcts
{
-namespace
-{
-
-static tcu::TestLog* currentLog;
-
-void setOutput(tcu::TestLog& log)
-{
- currentLog = &log;
-}
-
-void Output(const char* format, ...)
-{
- va_list args;
- va_start(args, format);
-
- const int MAX_OUTPUT_STRING_SIZE = 40000;
- static char temp[MAX_OUTPUT_STRING_SIZE];
-
- vsnprintf(temp, MAX_OUTPUT_STRING_SIZE - 1, format, args);
- temp[MAX_OUTPUT_STRING_SIZE - 1] = '\0';
-
- char* logLine = strtok(temp, "\n");
- while (logLine != NULL)
- {
- currentLog->writeMessage(logLine);
- logLine = strtok(NULL, "\n");
- }
- va_end(args);
-}
-
-} // anonymous namespace
-
/** Constructor
*
* @param context Test context
/* Instantiates all tests and adds them as children to the node */
void TessellationShaderErrors::init(void)
{
- setOutput(m_context.getTestContext().getLog());
addChild(new glcts::TessellationShaderError1InputBlocks(m_context, m_extParams));
addChild(new glcts::TessellationShaderError1InputVariables(m_context, m_extParams));
addChild(new glcts::TessellationShaderError2OutputBlocks(m_context, m_extParams));
gl.getShaderiv(*so_id_ptr, GL_COMPILE_STATUS, &compile_status);
GLU_EXPECT_NO_ERROR(gl.getError(), "glGetShaderiv() failed");
- Output("%s shader source:\n%s", so_type.c_str(), so_code_ptr);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << so_type << " shader source:\n"
+ << so_code_ptr << tcu::TestLog::EndMessage;
+
glw::GLint length = 0;
gl.getShaderiv(*so_id_ptr, GL_INFO_LOG_LENGTH, &length);
if (length > 1)
{
std::vector<glw::GLchar> log(length);
gl.getShaderInfoLog(*so_id_ptr, length, NULL, &log[0]);
- Output("shader info log\n%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "shader info log\n"
+ << &log[0] << tcu::TestLog::EndMessage;
}
switch (expected_compilation_result)
/* OK, this is valid. However, it no longer makes sense to try to
* link the program object at this point. */
should_try_to_link = false;
- Output("Compilation failed as allowed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation failed as allowed." << tcu::TestLog::EndMessage;
}
else
{
/* That's fine. */
- Output("Compilation passed as allowed.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation passed as allowed." << tcu::TestLog::EndMessage;
}
break;
{
/* OK. Mark the program object as non-linkable */
should_try_to_link = false;
- Output("Compilation failed as expected.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation failed as expected." << tcu::TestLog::EndMessage;
}
break;
else
{
/* That's fine. */
- Output("Compilation successful as expected.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Compilation successful as expected." << tcu::TestLog::EndMessage;
}
break;
{
std::vector<glw::GLchar> log(length);
gl.getProgramInfoLog(m_po_ids[n_po], length, NULL, &log[0]);
- Output("program info log\n%s\n", &log[0]);
+ m_context.getTestContext().getLog() << tcu::TestLog::Message << "program info log\n"
+ << &log[0] << tcu::TestLog::EndMessage;
}
switch (expected_linking_result)
else
{
/* That's OK */
- Output("Linking failed as expected.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Linking failed as expected." << tcu::TestLog::EndMessage;
}
break;
else
{
/* That's OK */
- Output("Linking succeeded as expected.\n");
+ m_context.getTestContext().getLog()
+ << tcu::TestLog::Message << "Linking succeeded as expected." << tcu::TestLog::EndMessage;
}
break;