<div dir="ltr">This test covers situation  mentioned in this bug  <a href="https://bugs.freedesktop.org/show_bug.cgi?id=106481">https://bugs.freedesktop.org/show_bug.cgi?id=106481</a> . Test is passing on radeon and failing on intel i965.<br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 6, 2018 at 12:57 PM Illia Iorin <<a href="mailto:illia.iorin@gmail.com">illia.iorin@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This test checks that if we allocate more memory for the buffer<br>
 than possible, we get GL_OUT_OF_MEMORY error.<br>
<br>
V2:<br>
  - check GL_ARB_texture_buffer_object extension<br>
  - change storage format to GL_RGBA32I<br>
  - check gl compat version 3.1 because<br>
        function glTexBuffer() require that version<br>
<br>
Signed-off-by: Illia Iorin <<a href="mailto:illia.iorin@globallogic.com" target="_blank">illia.iorin@globallogic.com</a>><br>
---<br>
 tests/opengl.py                               |  1 +<br>
 .../CMakeLists.gl.txt                         |  1 +<br>
 .../negative-bad-oom.c                        | 62 +++++++++++++++++++<br>
 3 files changed, 64 insertions(+)<br>
 create mode 100644 tests/spec/arb_texture_buffer_object/negative-bad-oom.c<br>
<br>
diff --git a/tests/opengl.py b/tests/opengl.py<br>
index 9c43d32c9..56cf4f041 100644<br>
--- a/tests/opengl.py<br>
+++ b/tests/opengl.py<br>
@@ -2365,6 +2365,7 @@ with profile.test_list.group_manager(<br>
     g(['arb_texture_buffer_object-max-size'], 'max-size')<br>
     g(['arb_texture_buffer_object-minmax'], 'minmax')<br>
     g(['arb_texture_buffer_object-negative-bad-bo'], 'negative-bad-bo')<br>
+    g(['arb_texture_buffer_object-negative-bad-oom'], 'negative-bad-oom')<br>
     g(['arb_texture_buffer_object-negative-bad-format'], 'negative-bad-format')<br>
     g(['arb_texture_buffer_object-negative-bad-target'], 'negative-bad-target')<br>
     g(['arb_texture_buffer_object-negative-unsupported'],<br>
diff --git a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt<br>
index 959ca0c2f..98d1e16d8 100644<br>
--- a/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_texture_buffer_object/CMakeLists.gl.txt<br>
@@ -25,3 +25,4 @@ piglit_add_executable (arb_texture_buffer_object-subdata-sync subdata-sync.c)<br>
 piglit_add_executable (arb_texture_buffer_object-unused-name unused-name.c)<br>
 piglit_add_executable (arb_texture_buffer_object-fetch-outside-bounds fetch-outside-bounds.c)<br>
 piglit_add_executable (arb_texture_buffer_object-indexed indexed.c)<br>
+piglit_add_executable (arb_texture_buffer_object-negative-bad-oom negative-bad-oom.c)<br>
\ No newline at end of file<br>
diff --git a/tests/spec/arb_texture_buffer_object/negative-bad-oom.c b/tests/spec/arb_texture_buffer_object/negative-bad-oom.c<br>
new file mode 100644<br>
index 000000000..4841f6a52<br>
--- /dev/null<br>
+++ b/tests/spec/arb_texture_buffer_object/negative-bad-oom.c<br>
@@ -0,0 +1,62 @@<br>
+/* Copyright © 2018 Illia Iorin <br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice (including the next<br>
+ * paragraph) shall be included in all copies or substantial portions of the<br>
+ * Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
+ * IN THE SOFTWARE.<br>
+ */<br>
+<br>
+/**@file negative-bad-oom.c <br>
+* This test checks  allocat more memory than possible, <br>
+* the glGetError() will return  GL_OUT_OF_MEMORY error flag <br>
+*/<br>
+#include "piglit-util-gl.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
+       config.supports_gl_compat_version = 31;<br>
+       config.supports_gl_core_version = 31;<br>
+<br>
+       config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;<br>
+       config.khr_no_error_support = PIGLIT_HAS_ERRORS;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       return PIGLIT_FAIL; /* UNREACHED */<br>
+}<br>
+<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_ARB_texture_buffer_object");<br>
+       GLuint tex, tbo;<br>
+       glGenBuffers(1, &tbo);<br>
+       glBindBuffer(GL_TEXTURE_BUFFER, tbo);<br>
+<br>
+       glGenTextures(1, &tex);<br>
+       glBindTexture(GL_TEXTURE_BUFFER, tex);<br>
+       glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA32I, tbo);<br>
+       glBufferData(GL_TEXTURE_BUFFER,<br>
+                    INT_MAX , NULL, GL_STATIC_READ);<br>
+       if (!piglit_check_gl_error(GL_OUT_OF_MEMORY))<br>
+               piglit_report_result(PIGLIT_FAIL);<br>
+       piglit_report_result(PIGLIT_PASS);<br>
+}<br>
\ No newline at end of file<br>
-- <br>
2.17.0<br>
<br>
</blockquote></div></div>