[Piglit] [PATCH 14/15] arb_direct_state_access: Testing GetNamedBufferPointerv.

Laura Ekstrand laura at jlekstrand.net
Fri Jan 23 11:03:38 PST 2015


---
 .../arb_direct_state_access/getnamedbufferparameter.c    | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
index 82bbfe2..45fc021 100644
--- a/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
+++ b/tests/spec/arb_direct_state_access/getnamedbufferparameter.c
@@ -22,8 +22,9 @@
  */
 
 /**
- * Adapted to test glGetNamedBufferParameteri[64]v by Laura Ekstrand
- * <laura at jlekstrand.net>.
+ * Adapted to test glGetNamedBufferParameteri[64]v and
+ * glGetNamedBufferPointerv by Laura Ekstrand <laura at jlekstrand.net>, January
+ * 2015.
  */
 
 #include "piglit-util-gl.h"
@@ -110,6 +111,7 @@ piglit_display(void)
 	bool pass = true;
 	GLuint bufname;
 	GLint64 data = -2;
+	void *dataptr = NULL;
 	GLint dataint = -2;
 
 	int stuff[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
@@ -167,13 +169,19 @@ piglit_display(void)
 
 	/* Is it mapped? */
 	glGetNamedBufferParameteri64v(bufname, GL_BUFFER_MAPPED, &data);
-	if (data != GL_TRUE)
-	{
+	if (data != GL_TRUE) {
 		printf("GL_BUFFER_MAPPED: expected GL_TRUE, got GL_FALSE.\n");
 		pass = false;
 	}
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
+	/* Check the pointer. */
+	glGetNamedBufferPointerv(bufname, GL_BUFFER_MAP_POINTER, &dataptr);
+	if (!dataptr) {
+		printf("GL_BUFFER_MAP_POINTER: Got NULL.\n");
+		pass = false;
+	}
+	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
 	/* What is the offset? */
 	glGetNamedBufferParameteri64v(bufname, GL_BUFFER_MAP_OFFSET,
-- 
2.1.0



More information about the Piglit mailing list