[PATCH] spoolss/test: Add a test for BuildOtherNamesFromMachineName
Detlef Riekenberg
wine.dev at web.de
Fri Oct 19 16:11:20 CDT 2007
---
dlls/spoolss/tests/spoolss.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/dlls/spoolss/tests/spoolss.c b/dlls/spoolss/tests/spoolss.c
index 3797785..602b925 100644
--- a/dlls/spoolss/tests/spoolss.c
+++ b/dlls/spoolss/tests/spoolss.c
@@ -33,6 +33,7 @@ #include "wine/test.h"
static HMODULE hwinspool;
static HMODULE hspl;
+static BOOL (WINAPI * pBuildOtherNamesFromMachineName)(LPWSTR **, LPDWORD);
static DWORD (WINAPI * pSplInitializeWinSpoolDrv)(LPVOID *);
#define WINSPOOL_TABLESIZE 16
@@ -51,6 +52,10 @@ static LPCSTR load_functions(void)
hspl = LoadLibraryA(ptr);
if (!hspl) return ptr;
+ ptr = "BuildOtherNamesFromMachineName";
+ pBuildOtherNamesFromMachineName = (void *) GetProcAddress(hspl, ptr);
+ if (!pBuildOtherNamesFromMachineName) return ptr;
+
ptr = "SplInitializeWinSpoolDrv";
pSplInitializeWinSpoolDrv = (void *) GetProcAddress(hspl, ptr);
if (!pSplInitializeWinSpoolDrv) return ptr;
@@ -90,6 +95,33 @@ static LPCSTR load_functions(void)
/* ########################### */
+static void test_BuildOtherNamesFromMachineName(void)
+{
+ LPWSTR *buffers;
+ DWORD numentries;
+ DWORD res;
+
+ buffers = NULL;
+ numentries = 0;
+
+ SetLastError(0xdeadbeef);
+ res = pBuildOtherNamesFromMachineName(&buffers, &numentries);
+
+ /* An array with 3 stringpointer is returned:
+ entry_#0: "" (empty String)
+ entry_#1: <hostname> (this is the same as the computernam)
+ entry_#2: <ip-address> (string with the ip-address of <hostname>)
+ */
+ todo_wine
+ ok( res && (buffers != NULL) && (numentries == 3) && (buffers[0] != NULL) && (buffers[0][0] == '\0'),
+ "got %u with %u and %p,%u (%p:%d)\n", res, GetLastError(), buffers, numentries,
+ ((numentries > 0) && buffers) ? buffers[0] : NULL,
+ ((numentries > 0) && buffers && buffers[0]) ? lstrlenW(buffers[0]) : -1);
+
+}
+
+/* ########################### */
+
static void test_SplInitializeWinSpoolDrv(VOID)
{
DWORD res;
@@ -124,6 +156,7 @@ START_TEST(spoolss)
return;
}
+ test_BuildOtherNamesFromMachineName();
test_SplInitializeWinSpoolDrv();
}
--
1.4.1
--=-myOk5uta7bvurLNpC+VM--
More information about the wine-patches
mailing list