mshtml: Added IHTMLWindow6::get_sessionStorage implementation.
[wine] / dlls / mpr / tests / mpr.c
1 /*
2  * Copyright 2012 Andrew Eikum for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #define COBJMACROS
20
21 #include <stdio.h>
22
23 #include "windows.h"
24 #include "winnetwk.h"
25 #include "wine/test.h"
26
27 static void test_WNetGetUniversalName(void)
28 {
29     DWORD ret;
30     char buffer[1024];
31     DWORD drive_type, info_size;
32     char driveA[] = "A:\\";
33     WCHAR driveW[] = {'A',':','\\',0};
34
35     for(; *driveA <= 'Z'; ++*driveA, ++*driveW){
36         drive_type = GetDriveTypeW(driveW);
37
38         info_size = sizeof(buffer);
39         ret = WNetGetUniversalNameA(driveA, UNIVERSAL_NAME_INFO_LEVEL,
40                 buffer, &info_size);
41
42         if(drive_type == DRIVE_REMOTE)
43             ok(ret == WN_NO_ERROR, "WNetGetUniversalNameA failed: %08x\n", ret);
44         else
45             /* WN_NO_NET_OR_BAD_PATH (DRIVE_FIXED) returned from the virtual drive (usual Q:)
46                created by the microsoft application virtualization client */
47             ok((ret == WN_NOT_CONNECTED) || (ret == WN_NO_NET_OR_BAD_PATH),
48                 "WNetGetUniversalNameA(%s, ...) returned %u (drive_type: %u)\n",
49                 driveA, ret, drive_type);
50
51         ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
52
53         info_size = sizeof(buffer);
54         ret = WNetGetUniversalNameW(driveW, UNIVERSAL_NAME_INFO_LEVEL,
55                 buffer, &info_size);
56
57         if(drive_type == DRIVE_REMOTE)
58             ok(ret == WN_NO_ERROR, "WNetGetUniversalNameW failed: %08x\n", ret);
59         else
60             ok((ret == WN_NOT_CONNECTED) || (ret == WN_NO_NET_OR_BAD_PATH),
61                 "WNetGetUniversalNameW(%s, ...) returned %u (drive_type: %u)\n",
62                 wine_dbgstr_w(driveW), ret, drive_type);
63
64         ok(info_size == sizeof(buffer), "Got wrong size: %u\n", info_size);
65     }
66 }
67
68 START_TEST(mpr)
69 {
70     test_WNetGetUniversalName();
71 }