[2/2] setupapi/tests: create dialog.c file with a first test for SetupPromptForDiskA

Ricardo Filipe ricardojdfilipe at gmail.com
Tue Mar 3 12:40:23 CST 2009


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090303/5ce46c0a/attachment.htm>
-------------- next part --------------
From bf5c157aa5ec8988677f5cf1fe53df1d39191492 Mon Sep 17 00:00:00 2001
From: Ricardo Filipe <ricardo_barbano at hotmail.com>
Date: Wed, 18 Feb 2009 09:59:43 +0000
Subject: setupapi/tests: create dialog.c file with a first test for
 SetupPromptForDiskA

---
 dlls/setupapi/tests/Makefile.in |    1 +
 dlls/setupapi/tests/dialog.c    |   54 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 dlls/setupapi/tests/dialog.c

diff --git a/dlls/setupapi/tests/Makefile.in b/dlls/setupapi/tests/Makefile.in
index 23b0f5e..19ea296 100644
--- a/dlls/setupapi/tests/Makefile.in
+++ b/dlls/setupapi/tests/Makefile.in
@@ -7,6 +7,7 @@ IMPORTS   = setupapi user32 advapi32 kernel32
 
 CTESTS = \
 	devinst.c \
+	dialog.c \
 	install.c \
 	misc.c \
 	parser.c \
diff --git a/dlls/setupapi/tests/dialog.c b/dlls/setupapi/tests/dialog.c
new file mode 100644
index 0000000..a850b54
--- /dev/null
+++ b/dlls/setupapi/tests/dialog.c
@@ -0,0 +1,54 @@
+/*
+ * Dialog tests
+ *
+ * Copyright 2009 Ricardo Filipe
+ *
+ * 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 <stdio.h>
+#include <string.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "setupapi.h"
+
+#include "wine/test.h"
+
+static BOOL (WINAPI *pSetupPromptForDiskA)(HWND, PCSTR, PCSTR, PCSTR, PCSTR, PCSTR, DWORD, PSTR, DWORD, PDWORD);
+
+static void test_SetupPromptForDisk(void)
+{
+    UINT ret;
+
+    SetLastError(0xdeadbeef);
+    ret=SetupPromptForDiskA(NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, NULL);
+    ok(ret == 1 && GetLastError() == ERROR_INVALID_PARAMETER, "ret=%d error %d: FileSought cannot be NULL\n", ret, GetLastError());
+}
+
+START_TEST(dialog)
+{
+    HMODULE hsetupapi = GetModuleHandle("setupapi.dll");
+    pSetupPromptForDiskA = (void*)GetProcAddress(hsetupapi, "SetupPromptForDiskA");
+
+    if (pSetupPromptForDiskA)
+        test_SetupPromptForDisk();
+    else
+        win_skip("SetupPromptForDiskA is not available\n");
+}
-- 
1.5.6.3


More information about the wine-patches mailing list