Commit 08943afd by Jamie Madill Committed by Commit Bot

Remove huge buffer data test.

This is too difficult to implement without mocking new/delete. BUG=angleproject:875 Change-Id: I7cdafe11d26939f14a43bc515454dd5cf70c4a2a Reviewed-on: https://chromium-review.googlesource.com/769849 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent fb7685f4
...@@ -135,77 +135,6 @@ TEST_P(BufferDataTest, NULLResolvedData) ...@@ -135,77 +135,6 @@ TEST_P(BufferDataTest, NULLResolvedData)
drawQuad(mProgram, "position", 0.5f); drawQuad(mProgram, "position", 0.5f);
} }
// Tests that a huge allocation returns GL_OUT_OF_MEMORY
// TODO(jmadill): Figure out how to test this reliably on the Chromium bots
TEST_P(BufferDataTest, DISABLED_HugeSetDataShouldNotCrash)
{
glBindBuffer(GL_ARRAY_BUFFER, mBuffer);
EXPECT_GL_NO_ERROR();
GLsizei allocSize = std::numeric_limits<GLsizei>::max() >> 2;
uint8_t *data = nullptr;
while (data == nullptr && allocSize >= 4)
{
data = new (std::nothrow) uint8_t[allocSize];
if (data == nullptr)
{
allocSize >>= 1;
}
}
ASSERT_NE(static_cast<uint8_t *>(nullptr), data);
memset(data, 0, allocSize);
float * fValue = reinterpret_cast<float*>(data);
for (unsigned int f = 0; f < 6; f++)
{
fValue[f] = 1.0f;
}
glBufferData(GL_ARRAY_BUFFER, allocSize, data, GL_STATIC_DRAW);
GLenum error = glGetError();
if (error == GL_NO_ERROR)
{
// If we didn't fail because of an out of memory error, try drawing a quad
// using the large buffer
// DISABLED because it takes a long time, but left for posterity
//glUseProgram(mProgram);
// glVertexAttribPointer(mAttribLocation, 1, GL_FLOAT, GL_FALSE, 4, nullptr);
// glEnableVertexAttribArray(mAttribLocation);
// glBindBuffer(GL_ARRAY_BUFFER, 0);
// drawQuad(mProgram, "position", 0.5f);
// swapBuffers();
//// Draw operations can also generate out-of-memory, which is in-spec
//error = glGetError();
//if (error == GL_NO_ERROR)
//{
// GLint viewportSize[4];
// glGetIntegerv(GL_VIEWPORT, viewportSize);
// GLint midPixelX = (viewportSize[0] + viewportSize[2]) / 2;
// GLint midPixelY = (viewportSize[1] + viewportSize[3]) / 2;
// EXPECT_PIXEL_EQ(midPixelX, midPixelY, 255, 0, 0, 255);
//}
//else
//{
// EXPECT_EQ(GL_OUT_OF_MEMORY, error);
//}
}
else
{
EXPECT_GLENUM_EQ(GL_OUT_OF_MEMORY, error);
}
delete[] data;
}
// Internally in D3D, we promote dynamic data to static after many draw loops. This code tests // Internally in D3D, we promote dynamic data to static after many draw loops. This code tests
// path. // path.
TEST_P(BufferDataTest, RepeatedDrawWithDynamic) TEST_P(BufferDataTest, RepeatedDrawWithDynamic)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment