From ce94e5bf1e8e14a637645243dcfd5c60a5070cfa Mon Sep 17 00:00:00 2001
From: Thomas Faber <thfabba@gmx.de>
Date: Tue, 27 Dec 2011 15:37:06 +0100
Subject: kernel32/tests: test that GetModuleFileName returns an absolute path

---
 dlls/kernel32/tests/module.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c
index e86b63b..63ea049 100644
--- a/dlls/kernel32/tests/module.c
+++ b/dlls/kernel32/tests/module.c
@@ -38,6 +38,12 @@ static BOOL cmpStrAW(const char* a, const WCHAR* b, DWORD lenA, DWORD lenB)
     return memcmp(aw, b, len * sizeof(WCHAR)) == 0;
 }
 
+static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch )
+{
+    do { if (*str == ch) return (WCHAR *)str; } while (*str++);
+    return NULL;
+}
+
 static void testGetModuleFileName(const char* name)
 {
     HMODULE     hMod;
@@ -55,6 +61,7 @@ static void testGetModuleFileName(const char* name)
        broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */
        "LastError was not reset: %u\n", GetLastError());
     ok(len1A > 0, "Getting module filename for handle %p\n", hMod);
+    ok(strchr(bufA, '\\') != NULL, "Got relative path: %s\n", bufA);
 
     if (is_unicode_enabled)
     {
@@ -65,6 +72,7 @@ static void testGetModuleFileName(const char* name)
            broken(GetLastError() == 0xdeadbeef), /* <= XP SP3 */
            "LastError was not reset: %u\n", GetLastError());
         ok(len1W > 0, "Getting module filename for handle %p\n", hMod);
+        ok(strchrW(bufW, '\\') != NULL, "Got relative path: %s\n", wine_dbgstr_w(bufW));
     }
 
     ok(len1A == strlen(bufA), "Unexpected length of GetModuleFilenameA (%d/%d)\n", len1A, lstrlenA(bufA));
-- 
1.7.1.GIT
