From: Carl Worth <cworth@cworth.org>
Date: Mon, 13 Aug 2012 02:42:35 +0000 (-0700)
Subject: trim-head: New test to ensure "apitrace trim" drops all calls after range
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=cfb133d5f5caa1eeecebe51a2a085b0df1774eb4;p=apitrace-tests

trim-head: New test to ensure "apitrace trim" drops all calls after range

This test ensures that all calls beyond the user-specified range are
correctly dropped. It also ensures that uninteresting calls are
trimmed, (since the glxsimple trace includes many of those).
---

diff --git a/traces/.gitignore b/traces/.gitignore
index a0f8a41..4f72b30 100644
--- a/traces/.gitignore
+++ b/traces/.gitignore
@@ -1,2 +1,3 @@
 !*.trace
 *.src.trace
+*-trim.trace
diff --git a/traces/README.markdown b/traces/README.markdown
index 2d5d675..805ab98 100644
--- a/traces/README.markdown
+++ b/traces/README.markdown
@@ -24,3 +24,6 @@ are used by the test scripts:
     any data from it.
 
 *   incomplete-call.trace:  trace with an incomplete call, with missing arguments
+
+*   glxsimple.trace: trace from a simple program showing drawing with
+    glClear, with GLSL shader, and with texture. See ../cli/src
\ No newline at end of file
diff --git a/traces/glxsimple.trace b/traces/glxsimple.trace
new file mode 100644
index 0000000..8726260
Binary files /dev/null and b/traces/glxsimple.trace differ
diff --git a/traces/trim-head.script b/traces/trim-head.script
new file mode 100644
index 0000000..70e8ef5
--- /dev/null
+++ b/traces/trim-head.script
@@ -0,0 +1,14 @@
+trim --calls=0-843 glxsimple.trace
+dump --verbose glxsimple-trim.trace
+0 glXChooseVisual(dpy = 0x236a280, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, GLX_RED_SIZE, GLX_GREEN_SIZE, GLX_RED_SIZE, GLX_BLUE_SIZE, GLX_RED_SIZE, GLX_ALPHA_SIZE, GLX_RED_SIZE, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, GLX_RED_SIZE, GLX_X_VISUAL_TYPE, GLX_DIRECT_COLOR, 0}) = &{visual = 0x2374ef8, visualid = 34, screen = 0, depth = 24, c_class = 5, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}
+1 glXCreateContext(dpy = 0x236a280, vis = &{visual = 0x2374ef8, visualid = 34, screen = 0, depth = 24, c_class = 5, red_mask = 16711680, green_mask = 65280, blue_mask = 255, colormap_size = 256, bits_per_rgb = 8}, shareList = NULL, direct = True) = 0x2384330
+2 glXMakeCurrent(dpy = 0x236a280, drawable = 41943041, ctx = 0x2384330) = True
+3 glViewport(x = 0, y = 0, width = 64, height = 64)
+4 glMatrixMode(mode = GL_PROJECTION)
+5 glLoadIdentity()
+6 glOrtho(left = 0, right = 64, bottom = 64, top = 0, zNear = 0, zFar = 1)
+7 glMatrixMode(mode = GL_MODELVIEW)
+8 glClearColor(red = 0, green = 0, blue = 1, alpha = 1)
+9 glClear(mask = GL_COLOR_BUFFER_BIT)
+10 glXSwapBuffers(dpy = 0x236a280, drawable = 41943041)
+