xlive: add initial tests, make them pass under Wine
Austin English
austinenglish at gmail.com
Tue Nov 2 02:13:01 CDT 2010
Test pass WTB (obviously, since it doesn't have xlive), as well as my
Win7 machine.
--
-Austin
-------------- next part --------------
From 8bc860314379161593bbadf6ed950963784e135a Mon Sep 17 00:00:00 2001
From: Austin English <austinenglish at gmail.com>
Date: Tue, 2 Nov 2010 07:01:33 +0000
Subject: [PATCH 4/4] xlive: add initial tests, make them pass under Wine
---
configure.ac | 1 +
dlls/xlive/main.c | 2 +-
dlls/xlive/tests/Makefile.in | 6 +++
dlls/xlive/tests/xlive.c | 81 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 89 insertions(+), 1 deletions(-)
create mode 100644 dlls/xlive/tests/Makefile.in
create mode 100644 dlls/xlive/tests/xlive.c
diff --git a/configure.ac b/configure.ac
index 69b62ba..2fbb9c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2800,6 +2800,7 @@ WINE_CONFIG_DLL(xinput1_3,,[xinput])
WINE_CONFIG_TEST(dlls/xinput1_3/tests)
WINE_CONFIG_DLL(xinput9_1_0)
WINE_CONFIG_DLL(xlive)
+WINE_CONFIG_TEST(dlls/xlive/tests)
WINE_CONFIG_DLL(xmllite)
WINE_CONFIG_TEST(dlls/xmllite/tests)
WINE_CONFIG_MAKEFILE([documentation])
diff --git a/dlls/xlive/main.c b/dlls/xlive/main.c
index 4657b9b..35f3b30 100644
--- a/dlls/xlive/main.c
+++ b/dlls/xlive/main.c
@@ -105,5 +105,5 @@ INT WINAPI XLIVE_5270(DWORD unknown, DWORD unknown2)
INT WINAPI XLIVE_5310(void)
{
FIXME("stub\n");
- return 0;
+ return 10093;
}
diff --git a/dlls/xlive/tests/Makefile.in b/dlls/xlive/tests/Makefile.in
new file mode 100644
index 0000000..04e6007
--- /dev/null
+++ b/dlls/xlive/tests/Makefile.in
@@ -0,0 +1,6 @@
+TESTDLL = xlive.dll
+
+C_SRCS = \
+ xlive.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/xlive/tests/xlive.c b/dlls/xlive/tests/xlive.c
new file mode 100644
index 0000000..72725c4
--- /dev/null
+++ b/dlls/xlive/tests/xlive.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2010 Austin English
+ *
+ * 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 <stdio.h>
+#include <windows.h>
+
+#include "wine/test.h"
+
+static BOOL (WINAPI *pXLIVE5002)(void);
+static BOOL (WINAPI *pXLIVE5310)(void);
+
+static HMODULE hmod;
+
+static BOOL InitFunctionPtrs(void)
+{
+ hmod = LoadLibraryA("xlive.dll");
+ if(!hmod)
+ {
+ win_skip("Could not load xlive.dll\n");
+ return FALSE;
+ }
+
+ pXLIVE5002 = (void *)GetProcAddress(hmod, (LPSTR)5002);
+ pXLIVE5310 = (void *)GetProcAddress(hmod, (LPSTR)5310);
+
+ return TRUE;
+}
+
+static void test_XLIVE_5002(void)
+{
+ HRESULT hr;
+
+ if(!pXLIVE5002)
+ {
+ win_skip("function not available, skipping test\n");
+ return;
+ }
+
+ hr = pXLIVE5002();
+ ok(hr == S_OK, "got %x, expected S_OK\n", hr);
+}
+
+static void test_XLIVE_5310(void)
+{
+ INT res;
+
+ if(!pXLIVE5310)
+ {
+ win_skip("function not available, skipping test\n");
+ return;
+ }
+
+ res = pXLIVE5310();
+ ok(res == 10093, "got %d, expected 10093\n", res);
+}
+
+START_TEST(xlive)
+{
+ if(!InitFunctionPtrs())
+ return;
+
+ test_XLIVE_5002();
+ test_XLIVE_5310();
+
+ FreeLibrary(hmod);
+}
--
1.6.4.4
More information about the wine-patches
mailing list