mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
remove version winetests
svn path=/trunk/; revision=17102
This commit is contained in:
parent
09c6b8868b
commit
53a628a613
2 changed files with 0 additions and 216 deletions
|
@ -1,191 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2004 Stefan Leichter
|
|
||||||
*
|
|
||||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include "wine/test.h"
|
|
||||||
#include "windef.h"
|
|
||||||
#include "winbase.h"
|
|
||||||
#include "winerror.h"
|
|
||||||
#include "winver.h"
|
|
||||||
|
|
||||||
#define MY_LAST_ERROR -1L
|
|
||||||
#define EXPECT_BAD_PATH__NOT_FOUND \
|
|
||||||
ok( (ERROR_PATH_NOT_FOUND == GetLastError()) || \
|
|
||||||
(ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError()) || \
|
|
||||||
(ERROR_FILE_NOT_FOUND == GetLastError()) || \
|
|
||||||
(ERROR_BAD_PATHNAME == GetLastError()), \
|
|
||||||
"Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND/ERROR_BAD_PATHNAME (98)/" \
|
|
||||||
"ERROR_PATH_NOT_FOUND (NT4)/ERROR_FILE_NOT_FOUND (2k3)" \
|
|
||||||
"expected, got 0x%08lx\n", GetLastError());
|
|
||||||
#define EXPECT_INVALID__NOT_FOUND \
|
|
||||||
ok( (ERROR_PATH_NOT_FOUND == GetLastError()) || \
|
|
||||||
(ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError()) || \
|
|
||||||
(ERROR_FILE_NOT_FOUND == GetLastError()) || \
|
|
||||||
(ERROR_INVALID_PARAMETER == GetLastError()), \
|
|
||||||
"Last error wrong! ERROR_RESOURCE_DATA_NOT_FOUND/ERROR_INVALID_PARAMETER (98)/" \
|
|
||||||
"ERROR_PATH_NOT_FOUND (NT4)/ERROR_FILE_NOT_FOUND (2k3)" \
|
|
||||||
"expected, got 0x%08lx\n", GetLastError());
|
|
||||||
|
|
||||||
static void test_info_size(void)
|
|
||||||
{ DWORD hdl, retval;
|
|
||||||
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( NULL, NULL);
|
|
||||||
ok( !retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
EXPECT_INVALID__NOT_FOUND;
|
|
||||||
|
|
||||||
hdl = 0x55555555;
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( NULL, &hdl);
|
|
||||||
ok( !retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
EXPECT_INVALID__NOT_FOUND;
|
|
||||||
ok( hdl == 0L,
|
|
||||||
"Handle wrong! 0L expected, got 0x%08lx\n", hdl);
|
|
||||||
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( "", NULL);
|
|
||||||
ok( !retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
EXPECT_BAD_PATH__NOT_FOUND;
|
|
||||||
|
|
||||||
hdl = 0x55555555;
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( "", &hdl);
|
|
||||||
ok( !retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
EXPECT_BAD_PATH__NOT_FOUND;
|
|
||||||
ok( hdl == 0L,
|
|
||||||
"Handle wrong! 0L expected, got 0x%08lx\n", hdl);
|
|
||||||
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( "kernel32.dll", NULL);
|
|
||||||
ok( retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
|
|
||||||
"Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
|
|
||||||
MY_LAST_ERROR, GetLastError());
|
|
||||||
|
|
||||||
hdl = 0x55555555;
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( "kernel32.dll", &hdl);
|
|
||||||
ok( retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
|
|
||||||
"Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
|
|
||||||
MY_LAST_ERROR, GetLastError());
|
|
||||||
ok( hdl == 0L,
|
|
||||||
"Handle wrong! 0L expected, got 0x%08lx\n", hdl);
|
|
||||||
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( "notexist.dll", NULL);
|
|
||||||
ok( !retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
ok( (ERROR_FILE_NOT_FOUND == GetLastError()) ||
|
|
||||||
(ERROR_RESOURCE_DATA_NOT_FOUND == GetLastError()) ||
|
|
||||||
(MY_LAST_ERROR == GetLastError()),
|
|
||||||
"Last error wrong! ERROR_FILE_NOT_FOUND/ERROR_RESOURCE_DATA_NOT_FOUND "
|
|
||||||
"(XP)/0x%08lx (NT4) expected, got 0x%08lx\n", MY_LAST_ERROR, GetLastError());
|
|
||||||
}
|
|
||||||
|
|
||||||
static void VersionDwordLong2String(DWORDLONG Version, LPSTR lpszVerString)
|
|
||||||
{
|
|
||||||
WORD a, b, c, d;
|
|
||||||
|
|
||||||
a = (WORD)(Version >> 48);
|
|
||||||
b = (WORD)((Version >> 32) & 0xffff);
|
|
||||||
c = (WORD)((Version >> 16) & 0xffff);
|
|
||||||
d = (WORD)(Version & 0xffff);
|
|
||||||
|
|
||||||
sprintf(lpszVerString, "%d.%d.%d.%d", a, b, c, d);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_info(void)
|
|
||||||
{
|
|
||||||
DWORD hdl, retval;
|
|
||||||
PVOID pVersionInfo = NULL;
|
|
||||||
BOOL boolret;
|
|
||||||
VS_FIXEDFILEINFO *pFixedVersionInfo;
|
|
||||||
UINT uiLength;
|
|
||||||
char VersionString[MAX_PATH];
|
|
||||||
DWORDLONG dwlVersion;
|
|
||||||
|
|
||||||
hdl = 0x55555555;
|
|
||||||
SetLastError(MY_LAST_ERROR);
|
|
||||||
retval = GetFileVersionInfoSizeA( "kernel32.dll", &hdl);
|
|
||||||
ok( retval,
|
|
||||||
"GetFileVersionInfoSizeA result wrong! <> 0L expected, got 0x%08lx\n",
|
|
||||||
retval);
|
|
||||||
ok((NO_ERROR == GetLastError()) || (MY_LAST_ERROR == GetLastError()),
|
|
||||||
"Last error wrong! NO_ERROR/0x%08lx (NT4) expected, got 0x%08lx\n",
|
|
||||||
MY_LAST_ERROR, GetLastError());
|
|
||||||
ok( hdl == 0L,
|
|
||||||
"Handle wrong! 0L expected, got 0x%08lx\n", hdl);
|
|
||||||
|
|
||||||
if ( retval == 0 || hdl != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pVersionInfo = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, retval );
|
|
||||||
ok(pVersionInfo != 0, "HeapAlloc failed\n" );
|
|
||||||
if (pVersionInfo == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
boolret = GetFileVersionInfoA( "kernel32.dll", 0, retval, 0);
|
|
||||||
ok (!boolret, "GetFileVersionInfoA should have failed: GetLastError = 0x%08lx\n", GetLastError());
|
|
||||||
ok ((GetLastError() == ERROR_INVALID_DATA) || (GetLastError() == ERROR_BAD_PATHNAME),
|
|
||||||
"Last error wrong! ERROR_INVALID_DATA/ERROR_BAD_PATHNAME (ME) expected, got 0x%08lx\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
boolret = GetFileVersionInfoA( "kernel32.dll", 0, retval, pVersionInfo );
|
|
||||||
ok (boolret, "GetFileVersionInfoA failed: GetLastError = 0x%08lx\n", GetLastError());
|
|
||||||
if (!boolret)
|
|
||||||
return;
|
|
||||||
|
|
||||||
boolret = VerQueryValueA( pVersionInfo, "\\", (LPVOID *)&pFixedVersionInfo, &uiLength );
|
|
||||||
ok (boolret, "VerQueryValueA failed: GetLastError = 0x%08lx\n", GetLastError());
|
|
||||||
if (!boolret)
|
|
||||||
return;
|
|
||||||
|
|
||||||
dwlVersion = (((DWORDLONG)pFixedVersionInfo->dwFileVersionMS) << 32) +
|
|
||||||
pFixedVersionInfo->dwFileVersionLS;
|
|
||||||
|
|
||||||
VersionDwordLong2String(dwlVersion, VersionString);
|
|
||||||
|
|
||||||
trace("kernel32.dll version: %s\n", VersionString);
|
|
||||||
|
|
||||||
boolret = VerQueryValueA( pVersionInfo, "\\", (LPVOID *)&pFixedVersionInfo, 0);
|
|
||||||
ok (boolret, "VerQueryValue failed: GetLastError = 0x%08lx\n", GetLastError());
|
|
||||||
}
|
|
||||||
|
|
||||||
START_TEST(info)
|
|
||||||
{
|
|
||||||
test_info_size();
|
|
||||||
test_info();
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
/* Automatically generated file; DO NOT EDIT!! */
|
|
||||||
|
|
||||||
/* stdarg.h is needed for Winelib */
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "windef.h"
|
|
||||||
#include "winbase.h"
|
|
||||||
|
|
||||||
extern void func_info(void);
|
|
||||||
|
|
||||||
struct test
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
void (*func)(void);
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct test winetest_testlist[] =
|
|
||||||
{
|
|
||||||
{ "info", func_info },
|
|
||||||
{ 0, 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
#define WINETEST_WANT_MAIN
|
|
||||||
#include "wine/test.h"
|
|
Loading…
Reference in a new issue