Module: wine
Branch: master
Commit: 2661e9abf70d2ffbc46a4d791754226246b0e30c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2661e9abf70d2ffbc46a4d791…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Thu Apr 29 23:41:27 2010 +0200
d3d9/tests: Fix test_cube_wrap() for different texture filtering schemes.
---
dlls/d3d9/tests/visual.c | 58 ++++++++++++++++++++++++++++++++++------------
1 files changed, 43 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 4e5e838..ca93be5 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -1143,7 +1143,14 @@ static void fog_test(IDirect3DDevice9 *device)
/* This test verifies the behaviour of cube maps wrt. texture wrapping.
* D3D cube map wrapping always behaves like GL_CLAMP_TO_EDGE,
- * regardless of the actual addressing mode set. */
+ * regardless of the actual addressing mode set. The way this test works is
+ * that we sample in one of the corners of the cubemap with filtering enabled,
+ * and check the interpolated color. There are essentially two reasonable
+ * things an implementation can do: Either pick one of the faces and
+ * interpolate the edge texel with itself (i.e., clamp within the face), or
+ * interpolate between the edge texels of the three involved faces. It should
+ * never involve the border color or the other side (texcoord wrapping) of a
+ * face in the interpolation. */
static void test_cube_wrap(IDirect3DDevice9 *device)
{
static const float quad[][6] = {
@@ -1173,6 +1180,7 @@ static void test_cube_wrap(IDirect3DDevice9 *device)
IDirect3DVertexDeclaration9 *vertex_declaration = NULL;
IDirect3DCubeTexture9 *texture = NULL;
IDirect3DSurface9 *surface = NULL;
+ IDirect3DSurface9 *face_surface;
D3DLOCKED_RECT locked_rect;
HRESULT hr;
UINT x;
@@ -1187,6 +1195,37 @@ static void test_cube_wrap(IDirect3DDevice9 *device)
D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surface, NULL);
ok(SUCCEEDED(hr), "CreateOffscreenPlainSurface failed (0x%08x)\n", hr);
+ hr = IDirect3DDevice9_CreateCubeTexture(device, 128, 1, 0, D3DFMT_A8R8G8B8,
+ D3DPOOL_DEFAULT, &texture, NULL);
+ ok(SUCCEEDED(hr), "CreateCubeTexture failed (0x%08x)\n", hr);
+
+ hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, 0);
+ ok(SUCCEEDED(hr), "LockRect failed (0x%08x)\n", hr);
+
+ for (y = 0; y < 128; ++y)
+ {
+ DWORD *ptr = (DWORD *)(((BYTE *)locked_rect.pBits) + (y * locked_rect.Pitch));
+ for (x = 0; x < 64; ++x)
+ {
+ *ptr++ = 0xff0000dd;
+ }
+ for (x = 64; x < 128; ++x)
+ {
+ *ptr++ = 0xffff0000;
+ }
+ }
+
+ hr = IDirect3DSurface9_UnlockRect(surface);
+ ok(SUCCEEDED(hr), "UnlockRect failed (0x%08x)\n", hr);
+
+ hr= IDirect3DCubeTexture9_GetCubeMapSurface(texture, 0, 0, &face_surface);
+ ok(SUCCEEDED(hr), "GetCubeMapSurface failed (0x%08x)\n", hr);
+
+ hr = IDirect3DDevice9_UpdateSurface(device, surface, NULL, face_surface, NULL);
+ ok(SUCCEEDED(hr), "UpdateSurface failed (0x%08x)\n", hr);
+
+ IDirect3DSurface9_Release(face_surface);
+
hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, 0);
ok(SUCCEEDED(hr), "LockRect failed (0x%08x)\n", hr);
@@ -1206,15 +1245,9 @@ static void test_cube_wrap(IDirect3DDevice9 *device)
hr = IDirect3DSurface9_UnlockRect(surface);
ok(SUCCEEDED(hr), "UnlockRect failed (0x%08x)\n", hr);
- hr = IDirect3DDevice9_CreateCubeTexture(device, 128, 1, 0, D3DFMT_A8R8G8B8,
- D3DPOOL_DEFAULT, &texture, NULL);
- ok(SUCCEEDED(hr), "CreateCubeTexture failed (0x%08x)\n", hr);
-
/* Create cube faces */
- for (face = 0; face < 6; ++face)
+ for (face = 1; face < 6; ++face)
{
- IDirect3DSurface9 *face_surface = NULL;
-
hr= IDirect3DCubeTexture9_GetCubeMapSurface(texture, face, 0, &face_surface);
ok(SUCCEEDED(hr), "GetCubeMapSurface failed (0x%08x)\n", hr);
@@ -1255,14 +1288,9 @@ static void test_cube_wrap(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_EndScene(device);
ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr);
- /* Due to the nature of this test, we sample essentially at the edge
- * between two faces. Because of this it's undefined from which face
- * the driver will sample. Fortunately that's not important for this
- * test, since all we care about is that it doesn't sample from the
- * other side of the surface or from the border. */
color = getPixelColor(device, 320, 240);
- ok(color == 0x00ff0000 || color == 0x000000ff,
- "Got color 0x%08x for addressing mode %s, expected 0x00ff0000 or 0x000000ff.\n",
+ ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0xff), 11),
+ "Got color 0x%08x for addressing mode %s, expected 0x000000ff.\n",
color, address_modes[x].name);
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
Module: tools
Branch: master
Commit: 8cddf9b3b753a825fa4633af607ba72d8d27e6a6
URL: http://source.winehq.org/git/tools.git/?a=commit;h=8cddf9b3b753a825fa4633af…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Mon May 3 13:38:34 2010 +0200
patches: Add server-side scripts for testbot result handling.
---
patches/expire | 6 +++
patches/filter-testbot | 82 ++++++++++++++++++++++++++++++++++++++++++++++++
patches/notify-bot | 35 ++++++++++++++++++++
3 files changed, 123 insertions(+), 0 deletions(-)
diff --git a/patches/expire b/patches/expire
index 0b3ac8c..a990bfa 100755
--- a/patches/expire
+++ b/patches/expire
@@ -116,6 +116,8 @@ foreach my $file (sort readdir DIR)
rename "$dir/$file", "$dir/OLD/$file";
rename "$dir/$file.status", "$dir/OLD/$file.status";
rename "$dir/$file.order", "$dir/OLD/$file.order";
+ rename "$dir/$file.testbot", "$dir/OLD/$file.testbot";
+ rename "$dir/$file.testfail", "$dir/OLD/$file.testfail";
}
}
else
@@ -126,6 +128,8 @@ foreach my $file (sort readdir DIR)
unlink "$dir/$file";
unlink "$dir/$file.status";
unlink "$dir/$file.order";
+ unlink "$dir/$file.testbot";
+ unlink "$dir/$file.testfail";
}
}
}
@@ -154,6 +158,8 @@ foreach my $file (sort readdir DIR)
unlink "$dir/OLD/$file";
unlink "$dir/OLD/$file.status";
unlink "$dir/OLD/$file.order";
+ unlink "$dir/OLD/$file.testbot";
+ unlink "$dir/OLD/$file.testfail";
}
}
}
diff --git a/patches/filter-testbot b/patches/filter-testbot
new file mode 100755
index 0000000..3c4e33b
--- /dev/null
+++ b/patches/filter-testbot
@@ -0,0 +1,82 @@
+#!/usr/bin/perl -w
+#
+# Filter a testbot result report.
+#
+# Copyright 2010 Alexandre Julliard
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+use strict;
+
+my $step = 0;
+my $patch = 0;
+my $failed = 0;
+
+while (<>)
+{
+ if (/^--- BEGIN GENERAL ---$/)
+ {
+ $step = 1;
+ next;
+ }
+ if (/^--- BEGIN NEW_ERRORS ---$/)
+ {
+ $step = 2;
+ next;
+ }
+ if (/^--- BEGIN FULL_LOGS ---$/)
+ {
+ $step = 3;
+ next;
+ }
+ if (/^--- END GENERAL ---$/)
+ {
+ die "no patch id found" unless $patch > 0;
+ if ($failed)
+ {
+ open TESTFAIL, ">patches/$patch.testfail" or die "cannot create $patch.testfail";
+ }
+ open TESTBOT, ">patches/$patch.testbot" or die "cannot create $patch.testbot";
+ $step = 0;
+ next;
+ }
+ if (/^--- END/)
+ {
+ $step = 0;
+ next;
+ }
+ if ($step == 1 && /^Patch: (\d+)/)
+ {
+ $patch = $1;
+ next;
+ }
+ if ($step == 1 && /^Test-Result:\s+Failed/)
+ {
+ $failed = 1;
+ next;
+ }
+ if ($step == 2 && $failed)
+ {
+ print TESTFAIL $_;
+ next;
+ }
+ if ($step == 3)
+ {
+ print TESTBOT $_;
+ next;
+ }
+}
+close TESTFAIL if $failed;
+close TESTBOT;
diff --git a/patches/notify-bot b/patches/notify-bot
new file mode 100755
index 0000000..104a496
--- /dev/null
+++ b/patches/notify-bot
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Notify winetestbot of the arrival of new patches
+#
+# Copyright 2010 Alexandre Julliard
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+notify_addr="$1"
+subject="New patches available at http://source.winehq.org/patches"
+test -n "$notify_addr" || exit 0
+
+old=`cat $HOME/.next-patch`
+next=$old
+while test -f /home/winehq/opt/source/patches/data/$next
+do
+ next=`expr $next + 1`
+done
+if test $next -gt $old
+then
+ echo $next >$HOME/.next-patch
+ echo "The latest patch is `expr $next - 1`" | Mail -s "$subject" "$notify_addr"
+fi