Assorted spelling fixes.
[wine] / dlls / version / tests / info.c
1 /*
2  * Copyright (C) 2004 Stefan Leichter
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #include <stdarg.h>
20
21 #include "wine/test.h"
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winerror.h"
25 #include "winver.h"
26
27 static void test_info_size(void)
28 {   DWORD hdl, retval;
29
30     SetLastError(-1L);
31     retval = GetFileVersionInfoSizeA( NULL, NULL);
32     ok( !retval,
33         "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
34         retval);
35     ok( ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError(),
36         "Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND expected, got 0x%08lx\n",
37         GetLastError());
38
39     hdl = 0x55555555;
40     SetLastError(-1L);
41     retval = GetFileVersionInfoSizeA( NULL, &hdl);
42     ok( !retval,
43         "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
44         retval);
45     ok( ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError(),
46         "Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND expected, got 0x%08lx\n",
47         GetLastError());
48     ok( hdl == 0L,
49         "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
50
51     SetLastError(-1L);
52     retval = GetFileVersionInfoSizeA( "", NULL);
53     ok( !retval,
54         "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
55         retval);
56     ok( ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError(),
57         "Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND expected, got 0x%08lx\n",
58         GetLastError());
59
60     hdl = 0x55555555;
61     SetLastError(-1L);
62     retval = GetFileVersionInfoSizeA( "", &hdl);
63     ok( !retval,
64         "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
65         retval);
66     ok( ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError(),
67         "Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND expected, got 0x%08lx\n",
68         GetLastError());
69     ok( hdl == 0L,
70         "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
71
72     SetLastError(-1L);
73     retval = GetFileVersionInfoSizeA( "kernel32.dll", NULL);
74     ok( retval,
75         "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
76         retval);
77     ok( NO_ERROR == GetLastError(),
78         "Last error wrong! NO_ERROR expected, got 0x%08lx\n",
79         GetLastError());
80
81     hdl = 0x55555555;
82     SetLastError(-1L);
83     retval = GetFileVersionInfoSizeA( "kernel32.dll", &hdl);
84     ok( retval,
85         "GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
86         retval);
87     ok( NO_ERROR == GetLastError(),
88         "Last error wrong! NO_ERROR expected, got 0x%08lx\n",
89         GetLastError());
90     ok( hdl == 0L,
91         "Handle wrong! 0L expected, got 0x%08lx\n", hdl);
92
93     SetLastError(-1L);
94     retval = GetFileVersionInfoSizeA( "notexist.dll", NULL);
95     ok( !retval,
96         "GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
97         retval);
98     ok( ERROR_FILE_NOT_FOUND == GetLastError(),
99         "Last error wrong! ERROR_FILE_NOT_FOUND expected, got 0x%08lx\n",
100         GetLastError());
101 }
102
103 START_TEST(info)
104 {
105     test_info_size();
106 }