Author: cfinck
Date: Mon Jun 26 15:19:07 2017
New Revision: 75208
URL:
http://svn.reactos.org/svn/reactos?rev=75208&view=rev
Log:
[NETAPI32_APITEST]
Add a simple API Test for netapi32.dll, only covering DsRoleGetPrimaryDomainInformation so
far.
It succeeds in ReactOS, but outputs a heap error in the debug log. In real world
applications, this later leads to a heap assertion failure.
Added:
trunk/rostests/apitests/netapi32/
trunk/rostests/apitests/netapi32/CMakeLists.txt (with props)
trunk/rostests/apitests/netapi32/DsRoleGetPrimaryDomainInformation.c (with props)
trunk/rostests/apitests/netapi32/testlist.c (with props)
Modified:
trunk/rostests/apitests/CMakeLists.txt
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] Mon Jun 26 15:19:07 2017
@@ -20,6 +20,7 @@
add_subdirectory(localspl)
add_subdirectory(msgina)
add_subdirectory(msvcrt)
+add_subdirectory(netapi32)
add_subdirectory(netshell)
add_subdirectory(ntdll)
add_subdirectory(ole32)
Added: trunk/rostests/apitests/netapi32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netapi32/CMakeLi…
==============================================================================
--- trunk/rostests/apitests/netapi32/CMakeLists.txt (added)
+++ trunk/rostests/apitests/netapi32/CMakeLists.txt [iso-8859-1] Mon Jun 26 15:19:07 2017
@@ -0,0 +1,10 @@
+
+list(APPEND SOURCE
+ DsRoleGetPrimaryDomainInformation.c
+ testlist.c)
+
+add_executable(netapi32_apitest ${SOURCE})
+target_link_libraries(netapi32_apitest wine ${PSEH_LIB})
+set_module_type(netapi32_apitest win32cui)
+add_importlibs(netapi32_apitest netapi32 msvcrt kernel32 ntdll)
+add_rostests_file(TARGET netapi32_apitest)
Propchange: trunk/rostests/apitests/netapi32/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/netapi32/DsRoleGetPrimaryDomainInformation.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netapi32/DsRoleG…
==============================================================================
--- trunk/rostests/apitests/netapi32/DsRoleGetPrimaryDomainInformation.c (added)
+++ trunk/rostests/apitests/netapi32/DsRoleGetPrimaryDomainInformation.c [iso-8859-1] Mon
Jun 26 15:19:07 2017
@@ -0,0 +1,27 @@
+/*
+ * PROJECT: ReactOS netapi32.dll API Tests
+ * LICENSE: GNU GPLv2 or any later version as published by the Free Software
Foundation
+ * PURPOSE: Tests for DsRoleGetPrimaryDomainInformation
+ * COPYRIGHT: Copyright 2017 Colin Finck <colin(a)reactos.org>
+ */
+
+#include <apitest.h>
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <dsrole.h>
+
+START_TEST(DsRoleGetPrimaryDomainInformation)
+{
+ DWORD dwErrorCode;
+ PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pInfo = NULL;
+
+ // Get information about the domain membership of this computer.
+ dwErrorCode = DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic,
(PBYTE*)&pInfo);
+ ok(dwErrorCode == ERROR_SUCCESS, "DsRoleGetPrimaryDomainInformation returns
%lu!\n", dwErrorCode);
+ ok(pInfo->MachineRole >= DsRole_RoleStandaloneWorkstation &&
pInfo->MachineRole <= DsRole_RolePrimaryDomainController,
"pInfo->MachineRole is %lu!\n", pInfo->MachineRole);
+
+ if (pInfo)
+ DsRoleFreeMemory(pInfo);
+}
Propchange: trunk/rostests/apitests/netapi32/DsRoleGetPrimaryDomainInformation.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/netapi32/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/netapi32/testlis…
==============================================================================
--- trunk/rostests/apitests/netapi32/testlist.c (added)
+++ trunk/rostests/apitests/netapi32/testlist.c [iso-8859-1] Mon Jun 26 15:19:07 2017
@@ -0,0 +1,20 @@
+/*
+ * PROJECT: ReactOS netapi32.dll API Tests
+ * LICENSE: GNU GPLv2 or any later version as published by the Free Software
Foundation
+ * PURPOSE: Test list
+ * COPYRIGHT: Copyright 2017 Colin Finck <colin(a)reactos.org>
+ */
+
+#define __ROS_LONG64__
+
+#define STANDALONE
+#include <apitest.h>
+
+extern void func_DsRoleGetPrimaryDomainInformation(void);
+
+const struct test winetest_testlist[] =
+{
+ { "DsRoleGetPrimaryDomainInformation",
func_DsRoleGetPrimaryDomainInformation },
+
+ { 0, 0 }
+};
Propchange: trunk/rostests/apitests/netapi32/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native