[RTL_APITEST] Move RtlIntSafe test from kmtest to rtl_apitest

This commit is contained in:
Timo Kreuzer 2023-05-20 12:02:03 +03:00
parent bdf52a9868
commit a3d22bba1a
5 changed files with 13 additions and 9 deletions

View file

@ -79,6 +79,7 @@ extern void func_RtlGetUnloadEventTrace(void);
extern void func_RtlHandle(void);
extern void func_RtlImageDirectoryEntryToData(void);
extern void func_RtlImageRvaToVa(void);
extern void func_RtlIntSafe(void);
extern void func_RtlIsNameLegalDOS8Dot3(void);
extern void func_RtlMemoryStream(void);
extern void func_RtlMultipleAllocateHeap(void);
@ -176,6 +177,7 @@ const struct test winetest_testlist[] =
{ "RtlHandle", func_RtlHandle },
{ "RtlImageDirectoryEntryToData", func_RtlImageDirectoryEntryToData },
{ "RtlImageRvaToVa", func_RtlImageRvaToVa },
{ "RtlIntSafe", func_RtlIntSafe },
{ "RtlIsNameLegalDOS8Dot3", func_RtlIsNameLegalDOS8Dot3 },
{ "RtlMemoryStream", func_RtlMemoryStream },
{ "RtlMultipleAllocateHeap", func_RtlMultipleAllocateHeap },

View file

@ -1,7 +1,7 @@
list(APPEND SOURCE
# To be filled
RtlIntSafe.c
)
if(ARCH STREQUAL "i386")

View file

@ -5,8 +5,7 @@
* PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
*/
#define KMT_EMULATE_KERNEL
#include <kmt_test.h>
#include <rtltests.h>
#define ENABLE_INTSAFE_SIGNED_FUNCTIONS
#include <ntintsafe.h>
@ -76,7 +75,7 @@ START_TEST(RtlIntSafe)
TEST_CONVERSION(Long, LONG, UInt, UINT, uint, 0, 0, STATUS_SUCCESS);
TEST_CONVERSION(Long, LONG, UInt, UINT, uint, 5, 5, STATUS_SUCCESS);
TEST_CONVERSION(Long, LONG, UInt, UINT, uint, LONG_MAX, LONG_MAX, STATUS_SUCCESS);
TEST_CONVERSION(Long, LONG, UInt, UINT, uint, INT_MAX, INT_MAX, STATUS_SUCCESS);
TEST_CONVERSION(Long, LONG, UInt, UINT, uint, -1, (UINT)-1, STATUS_INTEGER_OVERFLOW);
TEST_CONVERSION(Long, LONG, UInt, UINT, uint, LONG_MIN, (UINT)-1, STATUS_INTEGER_OVERFLOW);
@ -129,15 +128,15 @@ START_TEST(RtlIntSafe)
TEST_ADD(Int8, INT8, int, INT8_MIN, -1, (INT8)-1, STATUS_INTEGER_OVERFLOW);
TEST_ADD(Int8, INT8, int, INT8_MIN, INT8_MIN, (INT8)-1, STATUS_INTEGER_OVERFLOW);
TEST_ADD(LongLong, LONGLONG, longlong, 0, 0, 0, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, 5, 5, 10, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, 0, 0, (LONGLONG)0, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, 5, 5, (LONGLONG)10, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, 0, LONGLONG_MAX, LONGLONG_MAX, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, LONGLONG_MAX, 0, LONGLONG_MAX, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, LONGLONG_MAX - 1, 1, LONGLONG_MAX, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, LONGLONG_MAX, 1, (LONGLONG)-1, STATUS_INTEGER_OVERFLOW);
TEST_ADD(LongLong, LONGLONG, longlong, LONGLONG_MAX, INT8_MAX, (LONGLONG)-1, STATUS_INTEGER_OVERFLOW);
TEST_ADD(LongLong, LONGLONG, longlong, 0, -1, -1, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, -1, 0, -1, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, 0, -1, (LONGLONG)-1, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, -1, 0, (LONGLONG)-1, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, 0, LONGLONG_MIN, LONGLONG_MIN, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, LONGLONG_MIN, 0, LONGLONG_MIN, STATUS_SUCCESS);
TEST_ADD(LongLong, LONGLONG, longlong, LONGLONG_MAX, LONGLONG_MIN, (LONGLONG)-1, STATUS_SUCCESS);

View file

@ -4,9 +4,12 @@
#include <apitest.h>
extern void func_RtlCaptureContext(void);
extern void func_RtlIntSafe(void);
const struct test winetest_testlist[] =
{
{ "RtlIntSafe", func_RtlIntSafe },
#ifdef _M_AMD64
{ "RtlCaptureContext", func_RtlCaptureContext },
#endif

View file

@ -18,7 +18,7 @@ list(APPEND COMMON_SOURCE
example/GuardedMemory.c
rtl/RtlAvlTree.c
rtl/RtlException.c
rtl/RtlIntSafe.c
../apitests/rtl/RtlIntSafe.c
rtl/RtlMemory.c
rtl/RtlRegistry.c
rtl/RtlSplayTree.c