Module: wine
Branch: master
Commit: 05450b036611a8b7c5b5430bf89389dd397dda41
URL: http://source.winehq.org/git/wine.git/?a=commit;h=05450b036611a8b7c5b5430bf…
Author: Evan Stade <estade(a)gmail.com>
Date: Wed Jul 11 18:07:56 2007 -0700
gdiplus: Added GdipCreateMatrix2 test.
---
dlls/gdiplus/tests/Makefile.in | 1 +
dlls/gdiplus/tests/matrix.c | 60 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/dlls/gdiplus/tests/Makefile.in b/dlls/gdiplus/tests/Makefile.in
index 4d8662a..9eb9e51 100644
--- a/dlls/gdiplus/tests/Makefile.in
+++ b/dlls/gdiplus/tests/Makefile.in
@@ -8,6 +8,7 @@ IMPORTS = gdiplus kernel32
CTESTS = \
brush.c \
graphicspath.c \
+ matrix.c \
pen.c
@MAKE_TEST_RULES@
diff --git a/dlls/gdiplus/tests/matrix.c b/dlls/gdiplus/tests/matrix.c
new file mode 100644
index 0000000..d6fc0ed
--- /dev/null
+++ b/dlls/gdiplus/tests/matrix.c
@@ -0,0 +1,60 @@
+/*
+ * Unit test suite for matrices
+ *
+ * Copyright (C) 2007 Google (Evan Stade)
+ *
+ * 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 "gdiplus.h"
+#include "wine/test.h"
+
+#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
+
+static void test_constructor_destructor(void)
+{
+ GpStatus status;
+ GpMatrix *matrix = NULL;
+
+ status = GdipCreateMatrix2(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, &matrix);
+ expect(Ok, status);
+ ok(matrix != NULL, "Expected matrix to be initialized\n");
+
+ status = GdipDeleteMatrix(NULL);
+ expect(InvalidParameter, status);
+
+ status = GdipDeleteMatrix(matrix);
+ expect(Ok, status);
+}
+
+START_TEST(matrix)
+{
+ struct GdiplusStartupInput gdiplusStartupInput;
+ ULONG_PTR gdiplusToken;
+
+ gdiplusStartupInput.GdiplusVersion = 1;
+ gdiplusStartupInput.DebugEventCallback = NULL;
+ gdiplusStartupInput.SuppressBackgroundThread = 0;
+ gdiplusStartupInput.SuppressExternalCodecs = 0;
+
+ GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
+
+ test_constructor_destructor();
+
+ GdiplusShutdown(gdiplusToken);
+}