<div dir="ltr">ping<br><div class="gmail_extra"><br><div class="gmail_quote">2018-06-06 12:57 GMT+03:00 Illia Iorin <span dir="ltr"><<a href="mailto:illia.iorin@gmail.com" target="_blank">illia.iorin@gmail.com</a>></span>:<br><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_<wbr>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_manage<wbr>r(<br>
     g(['arb_texture_buffer_<wbr>object-max-size'], 'max-size')<br>
     g(['arb_texture_buffer_<wbr>object-minmax'], 'minmax')<br>
     g(['arb_texture_buffer_<wbr>object-negative-bad-bo'], 'negative-bad-bo')<br>
+    g(['arb_texture_buffer_object-<wbr>negative-bad-oom'], 'negative-bad-oom')<br>
     g(['arb_texture_buffer_<wbr>object-negative-bad-format'], 'negative-bad-format')<br>
     g(['arb_texture_buffer_<wbr>object-negative-bad-target'], 'negative-bad-target')<br>
     g(['arb_texture_buffer_<wbr>object-negative-unsupported'],<br>
diff --git a/tests/spec/arb_texture_buffe<wbr>r_object/CMakeLists.gl.txt b/tests/spec/arb_texture_buffe<wbr>r_object/CMakeLists.gl.txt<br>
index 959ca0c2f..98d1e16d8 100644<br>
--- a/tests/spec/arb_texture_buffe<wbr>r_object/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_texture_buffe<wbr>r_object/CMakeLists.gl.txt<br>
@@ -25,3 +25,4 @@ piglit_add_executable (arb_texture_buffer_object-sub<wbr>data-sync subdata-sync.c)<br>
 piglit_add_executable (arb_texture_buffer_object-unu<wbr>sed-name unused-name.c)<br>
 piglit_add_executable (arb_texture_buffer_object-fet<wbr>ch-outside-bounds fetch-outside-bounds.c)<br>
 piglit_add_executable (arb_texture_buffer_object-ind<wbr>exed indexed.c)<br>
+piglit_add_executable (arb_texture_buffer_object-neg<wbr>ative-bad-oom negative-bad-oom.c)<br>
\ No newline at end of file<br>
diff --git a/tests/spec/arb_texture_buffe<wbr>r_object/negative-bad-oom.c b/tests/spec/arb_texture_buffe<wbr>r_object/negative-bad-oom.c<br>
new file mode 100644<br>
index 000000000..4841f6a52<br>
--- /dev/null<br>
+++ b/tests/spec/arb_texture_buffe<wbr>r_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_ver<wbr>sion = 31;<br>
+       config.supports_gl_core_versi<wbr>on = 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_<wbr>ARB_texture_buffer_object");<br>
+       GLuint tex, tbo;<br>
+       glGenBuffers(1, &tbo);<br>
+       glBindBuffer(GL_TEXTURE_BUFFE<wbr>R, tbo);<br>
+<br>
+       glGenTextures(1, &tex);<br>
+       glBindTexture(GL_TEXTURE_BUFF<wbr>ER, tex);<br>
+       glTexBuffer(GL_TEXTURE_<wbr>BUFFER, GL_RGBA32I, tbo);<br>
+       glBufferData(GL_TEXTURE_BUFFE<wbr>R,<br>
+                    INT_MAX , NULL, GL_STATIC_READ);<br>
+       if (!piglit_check_gl_error(GL_OUT<wbr>_OF_MEMORY))<br>
+               piglit_report_result(PIGLIT_F<wbr>AIL);<br>
+       piglit_report_result(PIGLIT_P<wbr>ASS);<br>
+}<br>
\ No newline at end of file<br>
<span class="m_9019228598000255919HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
______________________________<wbr>_________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org" target="_blank">Piglit@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>