Module: wine
Branch: master
Commit: a11c7514630bfb1f8d1bf6403f7744cc14e7d775
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a11c7514630bfb1f8d1bf6403…
Author: Laurent Vromman <laurent(a)vromman.org>
Date: Sat Mar 31 13:01:20 2007 +0200
gdi32: Add two basic tests to check what WidenPath does.
---
dlls/gdi32/tests/Makefile.in | 1 +
dlls/gdi32/tests/path.c | 84 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/dlls/gdi32/tests/Makefile.in b/dlls/gdi32/tests/Makefile.in
index 96e2ce0..31cc771 100644
--- a/dlls/gdi32/tests/Makefile.in
+++ b/dlls/gdi32/tests/Makefile.in
@@ -16,6 +16,7 @@ CTESTS = \
mapping.c \
metafile.c \
palette.c \
+ path.c \
pen.c
@MAKE_TEST_RULES@
diff --git a/dlls/gdi32/tests/path.c b/dlls/gdi32/tests/path.c
new file mode 100644
index 0000000..0346b28
--- /dev/null
+++ b/dlls/gdi32/tests/path.c
@@ -0,0 +1,84 @@
+/*
+ * Unit test suite for paths
+ *
+ * Copyright 2007 Laurent Vromman
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+
+#include "wine/test.h"
+
+#include "winuser.h"
+#include "winerror.h"
+
+static void test_widenpath(void)
+{
+ HDC hdc = GetDC(0);
+ HPEN greenPen;
+ HPEN oldPen;
+ POINT pnt[6];
+ INT nSize;
+
+ /* Create a pen to be used in WidenPath */
+ greenPen = CreatePen(PS_SOLID, 10, RGB(0,0,0));
+ oldPen = SelectObject(hdc, greenPen);
+
+ /* Prepare a path */
+ pnt[0].x = 100;
+ pnt[0].y = 0;
+ pnt[1].x = 200;
+ pnt[1].y = 0;
+ pnt[2].x = 300;
+ pnt[2].y = 100;
+ pnt[3].x = 300;
+ pnt[3].y = 200;
+ pnt[4].x = 200;
+ pnt[4].y = 300;
+ pnt[5].x = 100;
+ pnt[5].y = 300;
+
+ /* Set a polyline path */
+ BeginPath(hdc);
+ Polyline(hdc, pnt, 6);
+ EndPath(hdc);
+
+ /* Widen the polyline path */
+ ok(WidenPath(hdc), "WidenPath fails while widening a poyline path.\n");
+
+ /* Test if WidenPath seems to have done his job */
+ nSize = GetPath(hdc, NULL, NULL, 0);
+ ok(nSize != -1, "GetPath fails after calling WidenPath.\n");
+ ok(nSize > 6, "Path number of points is to low. Should be more than 6 but is %d\n", nSize);
+
+ todo_wine {
+ /* Test WidenPath with an empty path */
+ SetLastError(0xdeadbeef);
+ BeginPath(hdc);
+ ok(WidenPath(hdc) == FALSE, "WidenPath fails while widening an empty path. Error : %d\n", GetLastError());
+ }
+
+ ReleaseDC(0, hdc);
+ return;
+}
+
+START_TEST(path)
+{
+ test_widenpath();
+}
Module: wine
Branch: master
Commit: 11f6e89f873e615650fc260ae80796d299cb3ab1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=11f6e89f873e615650fc260ae…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com>
Date: Sat Mar 31 12:14:10 2007 +0200
advapi32/tests: Reopen the main handle if needed.
---
dlls/advapi32/tests/registry.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
index f67364a..4296fd5 100644
--- a/dlls/advapi32/tests/registry.c
+++ b/dlls/advapi32/tests/registry.c
@@ -631,6 +631,16 @@ static void test_reg_close_key(void)
ret = RegCloseKey(NULL);
ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */
"expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", ret);
+
+ /* Check to see if we didn't potentially close our main handle, which could happen on win98 as
+ * win98 doesn't give a new handle when the same key is opened.
+ * Not re-opening will make some next tests fail.
+ */
+ if (hkey_main == hkHandle)
+ {
+ trace("The main handle is most likely closed, so re-opening\n");
+ RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey_main );
+ }
}
static void test_reg_delete_key(void)