<div dir="ltr"><div>Hi Aditya,<br><br></div><div>Thank you for your interest in testing ARB_direct_state_access.  Martin, Fredrik, and I have been working to implement this extension in Mesa and generating tests for the new entry points.<br><br></div><div>I'm confused about the purpose of this test.  It seems that you are trying to test errors thrown by CreateBuffers as well as the behavior of CreateBuffers when used with a VAO, but it's not quite clear what you are trying to accomplish.<br><br>Martin and I have developed a style for testing Create[object_name] tests that checks both error conditions and trivial use cases.  Last week, I sent out a test to the Piglit ML in this style for glCreateBuffers.  I think our style makes the function of the test more clear, and I'd encourage you to take a look at this test as well as the one for CreateFramebuffers, CreateTextures, and CreateTransformFeedbackObjects.<br><br></div><div>If you want to chat about this, you can send me an email or chat on IRC (I am ldeks).<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 8, 2015 at 5:31 PM, Aditya Atluri <span dir="ltr"><<a href="mailto:adityaavinash1@gmail.com" target="_blank">adityaavinash1@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 tests/spec/CMakeLists.txt             |   1 +<br>
 tests/spec/gl-4.5/CMakeLists.gl.txt   |  14 +++++<br>
 tests/spec/gl-4.5/CMakeLists.txt      |   1 +<br>
 tests/spec/gl-4.5/gl_create_buffers.c | 100 ++++++++++++++++++++++++++++++++++<br>
 4 files changed, 116 insertions(+)<br>
 create mode 100644 tests/spec/gl-4.5/CMakeLists.gl.txt<br>
 create mode 100644 tests/spec/gl-4.5/CMakeLists.txt<br>
 create mode 100644 tests/spec/gl-4.5/gl_create_buffers.c<br>
<br>
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt<br>
index 7423589..b3f0fa5 100644<br>
--- a/tests/spec/CMakeLists.txt<br>
+++ b/tests/spec/CMakeLists.txt<br>
@@ -100,6 +100,7 @@ add_subdirectory (gl-3.1)<br>
 add_subdirectory (gl-3.2)<br>
 add_subdirectory (gl-3.3)<br>
 add_subdirectory (gl-4.4)<br>
+add_subdirectory (gl-4.5)<br>
 add_subdirectory (gles-2.0)<br>
 add_subdirectory (gles-3.0)<br>
 add_subdirectory (glx_arb_create_context)<br>
diff --git a/tests/spec/gl-4.5/CMakeLists.gl.txt b/tests/spec/gl-4.5/CMakeLists.gl.txt<br>
new file mode 100644<br>
index 0000000..b85e031<br>
--- /dev/null<br>
+++ b/tests/spec/gl-4.5/CMakeLists.gl.txt<br>
@@ -0,0 +1,14 @@<br>
+include_directories(<br>
+       ${GLEXT_INCLUDE_DIR}<br>
+       ${OPENGL_INCLUDE_PATH}<br>
+)<br>
+<br>
+link_libraries (<br>
+       piglitutil_${piglit_target_api}<br>
+       ${OPENGL_gl_LIBRARY}<br>
+       ${OPENGL_glu_LIBRARY}<br>
+)<br>
+<br>
+piglit_add_executable (gl-4.5-create_buffers gl_create_buffers.c)<br></blockquote><div>We already have quite a few ARB_direct_state_access tests in tests/spec/arb_direct_state_access.  Can you put this test there instead?<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+# vim: ft=cmake:<br>
diff --git a/tests/spec/gl-4.5/CMakeLists.txt b/tests/spec/gl-4.5/CMakeLists.txt<br>
new file mode 100644<br>
index 0000000..144a306<br>
--- /dev/null<br>
+++ b/tests/spec/gl-4.5/CMakeLists.txt<br>
@@ -0,0 +1 @@<br>
+piglit_include_target_api()<br>
diff --git a/tests/spec/gl-4.5/gl_create_buffers.c b/tests/spec/gl-4.5/gl_create_buffers.c<br>
new file mode 100644<br>
index 0000000..e44d9c2<br>
--- /dev/null<br>
+++ b/tests/spec/gl-4.5/gl_create_buffers.c<br>
@@ -0,0 +1,100 @@<br>
+/*<br>
+ * Copyright (c) 2015 Aditya Atluri <<a href="mailto:adityaavinash1@gmail.com">adityaavinash1@gmail.com</a>><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>
+ * on the rights to use, copy, modify, merge, publish, distribute, sub<br>
+ * license, and/or sell copies of the Software, and to permit persons to whom<br>
+ * the 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,<br>
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND<br>
+ * NON-INFRINGEMENT.  IN NO EVENT SHALL AUTHORS AND/OR THEIR SUPPLIERS<br>
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN<br>
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN<br>
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br>
+ * SOFTWARE.<br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br></blockquote><div>Why do you need this include?  I don't see where you use it. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+#include "minmax-test.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
+       config.supports_gl_core_version = 45;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br></blockquote><div>Most of this code does not match Piglit style.  Please review the coding style in Piglit/HACKING.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+static bool check_create_buffers(char *function, bool check_valid) <br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+{<br>
+       bool pass = true;<br>
+<br>
+       if (check_valid) {<br>
+               if (!piglit_check_gl_error(GL_NO_ERROR)) {<br>
+                       fprintf(stderr, "error when testing valid "<br>
+                               "glCreateBuffers with %s\n",<br>
+                               function);<br>
+                       pass = false;<br>
+               }<br>
+       } else {<br>
+               if (!piglit_check_gl_error(GL_INVALID_VALUE)) {<br>
+                       fprintf(stderr, "GL_INVALID_VALUE should be generated when setting"<br>
+                               " %s stride too value large than MAX_VERTEX_ATTRIB_STRIDE\n",<br>
+                               function);<br>
+                       pass = false;<br>
+               }<br>
+       }<br>
+<br>
+       return pass;<br>
+}<br>
+<br>
+static bool test_create_buffers(GLuint n,<br></blockquote><div>Please align ------------------------------^^---------<< <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                                                       uint *buffers,<br>
+                                                       bool check_valid){<br>
+<br>
+       glCreateBuffers(n, buffers);<br>
+       if(n > 0){<br>
+               if(buffers[n-1] != n-1){<br>
+                       check_valid = false;<br>
+               }<br>
+       }else{<br>
+               check_valid = false;<br>
+       }<br>
+       return check_create_buffers("glCreateBuffers", check_valid);<br>
+}<br>
+<br>
+<br>
+void piglit_init(int argc, char **argv)<br>
+{<br>
+       bool pass = true;<br>
+<br>
+       GLuint vao;<br>
+       /* Create and bind a vertex array object, this is needed<br>
+          for glBindBuffer* tests */<br>
+       glGenVertexArrays(1, &vao);<br>
+       glBindVertexArray(vao);<br>
+<br>
+       const GLuint num_buffers = 10;<br>
+<br>
+       GLuint buf_objs[10];<br>
+<br>
+       /* Try passing the number of  value */<br>
+       pass = test_create_buffers(num_buffers, buf_objs, true) && pass;<br>
+<br>
+       /* Try passing a negative value */<br>
+       pass = test_create_buffers(0-num_buffers, buf_objs, false) && pass;<br>
+<br>
+       piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       return PIGLIT_PASS;<br>
+}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>