Author: tfaber
Date: Sat Apr 26 10:58:40 2014
New Revision: 62975
URL:
http://svn.reactos.org/svn/reactos?rev=62975&view=rev
Log:
[SETUPAPI_WINETEST]
- Move the devclass test to apitests, since it is not a Wine test
Added:
trunk/rostests/apitests/setupapi/
trunk/rostests/apitests/setupapi/CMakeLists.txt (with props)
trunk/rostests/apitests/setupapi/devclass.c
- copied, changed from r62928, trunk/rostests/winetests/setupapi/devclass.c
trunk/rostests/apitests/setupapi/testlist.c (with props)
Removed:
trunk/rostests/winetests/setupapi/devclass.c
Modified:
trunk/rostests/apitests/CMakeLists.txt
trunk/rostests/winetests/setupapi/CMakeLists.txt
trunk/rostests/winetests/setupapi/testlist.c
Modified: trunk/rostests/apitests/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?r…
==============================================================================
--- trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] Sat Apr 26 10:58:40 2014
@@ -13,6 +13,7 @@
add_subdirectory(msvcrt)
add_subdirectory(ntdll)
add_subdirectory(powrprof)
+add_subdirectory(setupapi)
add_subdirectory(shell32)
add_subdirectory(psapi)
add_subdirectory(user32)
Added: trunk/rostests/apitests/setupapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/setupapi/CMakeLi…
==============================================================================
--- trunk/rostests/apitests/setupapi/CMakeLists.txt (added)
+++ trunk/rostests/apitests/setupapi/CMakeLists.txt [iso-8859-1] Sat Apr 26 10:58:40 2014
@@ -0,0 +1,5 @@
+
+add_executable(setupapi_apitest devclass.c testlist.c)
+set_module_type(setupapi_apitest win32cui)
+add_importlibs(setupapi_apitest advapi32 setupapi msvcrt kernel32)
+add_cd_file(TARGET setupapi_apitest DESTINATION reactos/bin FOR all)
Propchange: trunk/rostests/apitests/setupapi/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Copied: trunk/rostests/apitests/setupapi/devclass.c (from r62928,
trunk/rostests/winetests/setupapi/devclass.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/setupapi/devclas…
==============================================================================
--- trunk/rostests/winetests/setupapi/devclass.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/setupapi/devclass.c [iso-8859-1] Sat Apr 26 10:58:40 2014
@@ -22,8 +22,6 @@
#include <stdarg.h>
#include <stdio.h>
-#undef __WINESRC__
-#undef __ROS_LONG64__
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
@@ -34,6 +32,10 @@
#include "wine/test.h"
+#define ok_lasterr(err) \
+ ok( GetLastError() == (err), \
+ "Expected error %lx, got %lx\n", (DWORD)(err), GetLastError() )
+
static GUID test_class_guid = { 0x4d36e967, 0xe325, 0x11ce, { 0xbf, 0xc1, 0x08, 0x00,
0x2b, 0xe1, 0x03, 0x18 } };
static char test_class_name[MAX_CLASS_NAME_LEN] = "DiskDrive";
@@ -65,14 +67,12 @@
SetLastError( 0xdeadbeef );
ok( !SetupDiBuildClassInfoList( 0, NULL, 0, NULL ),
"Fail expected" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx", ERROR_INVALID_PARAMETER, GetLastError()
);
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
ok( !SetupDiBuildClassInfoList( 0, NULL, 0, &required_size ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
+ ok_lasterr( ERROR_INSUFFICIENT_BUFFER );
guid_list = HeapAlloc( GetProcessHeap(), 0, ( required_size + 1 ) * sizeof( GUID )
);
if ( !guid_list )
@@ -104,14 +104,12 @@
SetLastError( 0xdeadbeef );
ok( !SetupDiClassGuidsFromNameA( NULL, NULL, 0, NULL ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
ok( !SetupDiClassGuidsFromNameA( NULL, NULL, 0, &required_size ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
ok( SetupDiClassGuidsFromNameA( "", NULL, 0, &required_size ),
@@ -121,8 +119,7 @@
SetLastError( 0xdeadbeef );
ok( !SetupDiClassGuidsFromNameA( test_class_name, NULL, 0, &required_size ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
+ ok_lasterr( ERROR_INSUFFICIENT_BUFFER );
ok( required_size > 0, "Expected > 0, got %lu\n", required_size );
guid_list = HeapAlloc( GetProcessHeap(), 0, ( required_size + 1 ) * sizeof( GUID )
);
@@ -153,20 +150,17 @@
SetLastError( 0xdeadbeef );
ok( !SetupDiClassNameFromGuidA( NULL, NULL, 0, NULL ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
+ ok_lasterr( ERROR_INVALID_CLASS );
SetLastError( 0xdeadbeef );
ok( !SetupDiClassNameFromGuidA( NULL, NULL, 0, &required_size ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
+ ok_lasterr( ERROR_INVALID_CLASS );
SetLastError( 0xdeadbeef );
ok( !SetupDiClassNameFromGuidA( &test_class_guid, NULL, 0, &required_size ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
+ ok_lasterr( ERROR_INSUFFICIENT_BUFFER );
ok( required_size > 0, "Expected > 0, got %lu\n", required_size );
ok( required_size < MAX_CLASS_NAME_LEN, "Expected < %u, got %lu\n",
MAX_CLASS_NAME_LEN, required_size );
@@ -198,20 +192,17 @@
SetLastError( 0xdeadbeef );
ok( !SetupDiGetClassDescriptionA( NULL, NULL, 0, NULL ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
ok( !SetupDiGetClassDescriptionA( NULL, NULL, 0, &required_size ),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
ok( !SetupDiGetClassDescriptionA( &test_class_guid, NULL, 0, &required_size
),
"Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
+ ok_lasterr( ERROR_INSUFFICIENT_BUFFER );
ok( required_size > 0, "Expected > 0, got %lu\n", required_size );
ok( required_size < LINE_LEN, "Expected < %u, got %lu\n", LINE_LEN,
required_size );
@@ -239,8 +230,7 @@
device_info = SetupDiGetClassDevs( NULL, NULL, NULL, 0 );
ok( device_info == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
device_info = SetupDiGetClassDevs( NULL, NULL, NULL, DIGCF_ALLCLASSES );
@@ -254,8 +244,7 @@
device_info = SetupDiGetClassDevs( NULL, NULL, NULL, DIGCF_DEVICEINTERFACE );
ok( device_info == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
+ ok_lasterr( ERROR_INVALID_PARAMETER );
SetLastError( 0xdeadbeef );
device_info = SetupDiGetClassDevs( &test_class_guid, NULL, NULL, 0 );
@@ -269,8 +258,7 @@
device_info = SetupDiGetClassDevs( NULL, "(invalid enumerator)", NULL,
DIGCF_ALLCLASSES );
ok( device_info == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_DATA,
- "Expected error %lx, got %lx\n", ERROR_INVALID_DATA, GetLastError() );
+ ok_lasterr( ERROR_INVALID_DATA );
SetLastError( 0xdeadbeef );
device_info = SetupDiGetClassDevs( NULL, "Root", NULL, DIGCF_ALLCLASSES );
@@ -290,29 +278,25 @@
hkey = SetupDiOpenClassRegKeyExA( NULL, 0, 0, NULL, NULL );
ok( hkey == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_FLAGS,
- "Expected error %lx, got %lx\n", ERROR_INVALID_FLAGS, GetLastError()
);
+ ok_lasterr( ERROR_INVALID_FLAGS );
SetLastError( 0xdeadbeef );
hkey = SetupDiOpenClassRegKeyExA( NULL, 0, DIOCR_INSTALLER | DIOCR_INTERFACE, NULL,
NULL );
ok( hkey == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_FLAGS,
- "Expected error %lx, got %lx\n", ERROR_INVALID_FLAGS, GetLastError()
);
+ ok_lasterr( ERROR_INVALID_FLAGS );
SetLastError( 0xdeadbeef );
hkey = SetupDiOpenClassRegKeyExA( NULL, 0, DIOCR_INSTALLER, NULL, NULL );
ok( hkey == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
+ ok_lasterr( ERROR_INVALID_CLASS );
SetLastError( 0xdeadbeef );
hkey = SetupDiOpenClassRegKeyExA( NULL, 0, DIOCR_INTERFACE, NULL, NULL );
ok( hkey == INVALID_HANDLE_VALUE,
"Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
+ ok_lasterr( ERROR_INVALID_CLASS );
SetLastError( 0xdeadbeef );
hkey = SetupDiOpenClassRegKeyExA( NULL, KEY_QUERY_VALUE, DIOCR_INSTALLER, NULL, NULL
);
Added: trunk/rostests/apitests/setupapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/setupapi/testlis…
==============================================================================
--- trunk/rostests/apitests/setupapi/testlist.c (added)
+++ trunk/rostests/apitests/setupapi/testlist.c [iso-8859-1] Sat Apr 26 10:58:40 2014
@@ -0,0 +1,12 @@
+#define __ROS_LONG64__
+
+#define STANDALONE
+#include <apitest.h>
+
+extern void func_devclass(void);
+
+const struct test winetest_testlist[] =
+{
+ { "devclass", func_devclass },
+ { 0, 0 }
+};
Propchange: trunk/rostests/apitests/setupapi/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/winetests/setupapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/CMakeL…
==============================================================================
--- trunk/rostests/winetests/setupapi/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/winetests/setupapi/CMakeLists.txt [iso-8859-1] Sat Apr 26 10:58:40
2014
@@ -1,6 +1,5 @@
list(APPEND SOURCE
- devclass.c
devinst.c
diskspace.c
install.c
@@ -15,7 +14,3 @@
set_module_type(setupapi_winetest win32cui)
add_importlibs(setupapi_winetest advapi32 setupapi user32 msvcrt kernel32)
add_cd_file(TARGET setupapi_winetest DESTINATION reactos/bin FOR all)
-
-if(NOT MSVC)
- add_target_compile_flags(setupapi_winetest "-Wno-error=format")
-endif()
Removed: trunk/rostests/winetests/setupapi/devclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/devcla…
==============================================================================
--- trunk/rostests/winetests/setupapi/devclass.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/setupapi/devclass.c (removed)
@@ -1,347 +0,0 @@
-/*
- * SetupAPI device class-related functions tests
- *
- * Copyright 2006 Hervé Poussineau
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence as
- * published by the Free Software Foundation; either version 2 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this library; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#undef __WINESRC__
-#undef __ROS_LONG64__
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winreg.h"
-#include "cfgmgr32.h"
-#include "setupapi.h"
-
-#include "wine/test.h"
-
-static GUID test_class_guid = { 0x4d36e967, 0xe325, 0x11ce, { 0xbf, 0xc1, 0x08, 0x00,
0x2b, 0xe1, 0x03, 0x18 } };
-static char test_class_name[MAX_CLASS_NAME_LEN] = "DiskDrive";
-
-static const char *debugstr_guid(const GUID *guid)
-{
- static char guidSTR1[39];
- static char guidSTR2[39];
- char* guidSTR;
- static BOOL index;
-
- if (!guid) return NULL;
-
- index = !index;
- guidSTR = index ? guidSTR1 : guidSTR2;
-
- snprintf(guidSTR, sizeof(guidSTR1),
- "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- guid->Data1, guid->Data2, guid->Data3,
- guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
- guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
- return guidSTR;
-}
-
-static void test_SetupDiBuildClassInfoList(void)
-{
- LPGUID guid_list = NULL;
- DWORD required_size, size;
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiBuildClassInfoList( 0, NULL, 0, NULL ),
- "Fail expected" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx", ERROR_INVALID_PARAMETER, GetLastError()
);
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiBuildClassInfoList( 0, NULL, 0, &required_size ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
-
- guid_list = HeapAlloc( GetProcessHeap(), 0, ( required_size + 1 ) * sizeof( GUID )
);
- if ( !guid_list )
- return;
-
- SetLastError( 0xdeadbeef );
- ok( SetupDiBuildClassInfoList( 0, guid_list, required_size, &size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
- SetLastError( 0xdeadbeef );
- ok( SetupDiBuildClassInfoList( 0, guid_list, required_size + 1, &size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
-
- if ( size > 0 )
- {
- /* That's better to use the first class found, as we know for sure that it
exists */
- memcpy(&test_class_guid, &guid_list[0], sizeof( GUID ) );
- SetupDiClassNameFromGuidA( &test_class_guid, test_class_name, sizeof(
test_class_name ), NULL );
- }
- HeapFree( GetProcessHeap(), 0, guid_list );
-}
-
-static void test_SetupDiClassGuidsFromNameA(void)
-{
- LPGUID guid_list = NULL;
- DWORD required_size, size;
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiClassGuidsFromNameA( NULL, NULL, 0, NULL ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiClassGuidsFromNameA( NULL, NULL, 0, &required_size ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
-
- SetLastError( 0xdeadbeef );
- ok( SetupDiClassGuidsFromNameA( "", NULL, 0, &required_size ),
- "Error reported %lx\n", GetLastError() );
- ok( required_size == 0, "Expected 0, got %lu\n", required_size );
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiClassGuidsFromNameA( test_class_name, NULL, 0, &required_size ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
- ok( required_size > 0, "Expected > 0, got %lu\n", required_size );
-
- guid_list = HeapAlloc( GetProcessHeap(), 0, ( required_size + 1 ) * sizeof( GUID )
);
- if ( !guid_list )
- return;
-
- SetLastError( 0xdeadbeef );
- ok( SetupDiClassGuidsFromNameA( test_class_name, guid_list, required_size, &size
),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
- ok( IsEqualIID( &guid_list[0], &test_class_guid ),
- "Expected %s, got %s\n", debugstr_guid( &test_class_guid ),
debugstr_guid( &guid_list[0] ) );
- SetLastError( 0xdeadbeef );
- ok( SetupDiClassGuidsFromNameA( test_class_name, guid_list, required_size + 1,
&size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
- ok( IsEqualIID( &guid_list[0], &test_class_guid ),
- "Expected %s, got %s\n", debugstr_guid( &test_class_guid ),
debugstr_guid( &guid_list[0] ) );
-
- HeapFree( GetProcessHeap(), 0, guid_list );
-}
-
-static void test_SetupDiClassNameFromGuidA(void)
-{
- CHAR* class_name = NULL;
- DWORD required_size, size;
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiClassNameFromGuidA( NULL, NULL, 0, NULL ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiClassNameFromGuidA( NULL, NULL, 0, &required_size ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiClassNameFromGuidA( &test_class_guid, NULL, 0, &required_size ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
- ok( required_size > 0, "Expected > 0, got %lu\n", required_size );
- ok( required_size < MAX_CLASS_NAME_LEN, "Expected < %u, got %lu\n",
MAX_CLASS_NAME_LEN, required_size );
-
- class_name = HeapAlloc( GetProcessHeap(), 0, required_size );
- if ( !class_name )
- return;
-
- SetLastError( 0xdeadbeef );
- ok( SetupDiClassNameFromGuidA( &test_class_guid, class_name, required_size,
&size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
- ok( !strcmp( class_name, test_class_name ),
- "Expected %s, got %s\n", test_class_name, class_name );
- SetLastError( 0xdeadbeef );
- ok( SetupDiClassNameFromGuidA( &test_class_guid, class_name, required_size + 1,
&size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
- ok( !strcmp( class_name, test_class_name ),
- "Expected %s, got %s\n", test_class_name, class_name );
-
- HeapFree( GetProcessHeap(), 0, class_name );
-}
-
-static void test_SetupDiGetClassDescriptionA(void)
-{
- CHAR* class_desc = NULL;
- DWORD required_size, size;
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiGetClassDescriptionA( NULL, NULL, 0, NULL ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiGetClassDescriptionA( NULL, NULL, 0, &required_size ),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
-
- SetLastError( 0xdeadbeef );
- ok( !SetupDiGetClassDescriptionA( &test_class_guid, NULL, 0, &required_size
),
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INSUFFICIENT_BUFFER,
- "Expected error %lx, got %lx\n", ERROR_INSUFFICIENT_BUFFER,
GetLastError() );
- ok( required_size > 0, "Expected > 0, got %lu\n", required_size );
- ok( required_size < LINE_LEN, "Expected < %u, got %lu\n", LINE_LEN,
required_size );
-
- class_desc = HeapAlloc( GetProcessHeap(), 0, required_size );
- if ( !class_desc )
- return;
-
- SetLastError( 0xdeadbeef );
- ok( SetupDiGetClassDescriptionA( &test_class_guid, class_desc, required_size,
&size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
- SetLastError( 0xdeadbeef );
- ok( SetupDiGetClassDescriptionA( &test_class_guid, class_desc, required_size + 1,
&size ),
- "Error reported %lx\n", GetLastError() );
- ok( size == required_size, "Expected size %lu, got %lu\n", required_size,
size );
-
- HeapFree( GetProcessHeap(), 0, class_desc );
-}
-
-static void test_SetupDiGetClassDevsA(void)
-{
- HDEVINFO device_info;
-
- SetLastError( 0xdeadbeef );
- device_info = SetupDiGetClassDevs( NULL, NULL, NULL, 0 );
- ok( device_info == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
-
- SetLastError( 0xdeadbeef );
- device_info = SetupDiGetClassDevs( NULL, NULL, NULL, DIGCF_ALLCLASSES );
- ok( device_info != INVALID_HANDLE_VALUE,
- "Error reported %lx\n", GetLastError() );
- SetLastError( 0xdeadbeef );
- ok( SetupDiDestroyDeviceInfoList( device_info ),
- "Error reported %lx\n", GetLastError() );
-
- SetLastError( 0xdeadbeef );
- device_info = SetupDiGetClassDevs( NULL, NULL, NULL, DIGCF_DEVICEINTERFACE );
- ok( device_info == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected error %lx, got %lx\n", ERROR_INVALID_PARAMETER,
GetLastError() );
-
- SetLastError( 0xdeadbeef );
- device_info = SetupDiGetClassDevs( &test_class_guid, NULL, NULL, 0 );
- ok( device_info != INVALID_HANDLE_VALUE,
- "Error reported %lx\n", GetLastError() );
- SetLastError( 0xdeadbeef );
- ok( SetupDiDestroyDeviceInfoList( device_info ),
- "Error reported %lx\n", GetLastError() );
-
- SetLastError( 0xdeadbeef );
- device_info = SetupDiGetClassDevs( NULL, "(invalid enumerator)", NULL,
DIGCF_ALLCLASSES );
- ok( device_info == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_DATA,
- "Expected error %lx, got %lx\n", ERROR_INVALID_DATA, GetLastError() );
-
- SetLastError( 0xdeadbeef );
- device_info = SetupDiGetClassDevs( NULL, "Root", NULL, DIGCF_ALLCLASSES );
- ok( device_info != INVALID_HANDLE_VALUE,
- "Error reported %lx\n", GetLastError() );
- SetLastError( 0xdeadbeef );
- ok( SetupDiDestroyDeviceInfoList( device_info ),
- "Error reported %lx\n", GetLastError() );
-}
-
-static void test_SetupDiOpenClassRegKeyExA(void)
-{
- HKEY hkey;
- LONG err;
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( NULL, 0, 0, NULL, NULL );
- ok( hkey == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_FLAGS,
- "Expected error %lx, got %lx\n", ERROR_INVALID_FLAGS, GetLastError()
);
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( NULL, 0, DIOCR_INSTALLER | DIOCR_INTERFACE, NULL,
NULL );
- ok( hkey == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_FLAGS,
- "Expected error %lx, got %lx\n", ERROR_INVALID_FLAGS, GetLastError()
);
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( NULL, 0, DIOCR_INSTALLER, NULL, NULL );
- ok( hkey == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( NULL, 0, DIOCR_INTERFACE, NULL, NULL );
- ok( hkey == INVALID_HANDLE_VALUE,
- "Fail expected\n" );
- ok( GetLastError() == ERROR_INVALID_CLASS,
- "Expected error %x, got %lx\n", ERROR_INVALID_CLASS, GetLastError() );
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( NULL, KEY_QUERY_VALUE, DIOCR_INSTALLER, NULL, NULL
);
- ok( hkey != INVALID_HANDLE_VALUE, "Got error %lx\n", GetLastError() );
- err = RegCloseKey( hkey );
- ok( err == ERROR_SUCCESS, "Got error %lx\n", err );
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( NULL, KEY_QUERY_VALUE, DIOCR_INTERFACE, NULL, NULL
);
- ok( hkey != INVALID_HANDLE_VALUE, "Got error %lx\n", GetLastError() );
- err = RegCloseKey( hkey );
- ok( err == ERROR_SUCCESS, "Got error %lx\n", err );
-
- SetLastError( 0xdeadbeef );
- hkey = SetupDiOpenClassRegKeyExA( &test_class_guid, KEY_QUERY_VALUE,
DIOCR_INSTALLER, NULL, NULL );
- ok( hkey != INVALID_HANDLE_VALUE, "Got error %lx\n", GetLastError() );
- err = RegCloseKey( hkey );
- ok( err == ERROR_SUCCESS, "Got error %lx\n", err );
-
- err = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"System\\CurrentControlSet\\Control\\Class", 0, KEY_SET_VALUE, &hkey);
- ok( err == ERROR_SUCCESS, "Got error %lx\n", err );
-}
-
-START_TEST(devclass)
-{
- test_SetupDiBuildClassInfoList();
- test_SetupDiClassGuidsFromNameA();
- test_SetupDiClassNameFromGuidA();
- test_SetupDiGetClassDescriptionA();
- test_SetupDiGetClassDevsA();
- test_SetupDiOpenClassRegKeyExA();
-}
Modified: trunk/rostests/winetests/setupapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/testli…
==============================================================================
--- trunk/rostests/winetests/setupapi/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/setupapi/testlist.c [iso-8859-1] Sat Apr 26 10:58:40 2014
@@ -3,7 +3,6 @@
#define STANDALONE
#include <wine/test.h>
-extern void func_devclass(void);
extern void func_devinst(void);
extern void func_diskspace(void);
extern void func_install(void);
@@ -15,7 +14,6 @@
const struct test winetest_testlist[] =
{
- { "devclass", func_devclass },
{ "devinst", func_devinst },
{ "diskspace", func_diskspace },
{ "install", func_install },