https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3d22bba1af38a8f85857…
commit a3d22bba1af38a8f8585736257767000466485aa
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat May 20 12:02:03 2023 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Fri Nov 10 19:00:41 2023 +0200
[RTL_APITEST] Move RtlIntSafe test from kmtest to rtl_apitest
---
modules/rostests/apitests/ntdll/testlist.c | 2 ++
modules/rostests/apitests/rtl/CMakeLists.txt | 2 +-
modules/rostests/{kmtests => apitests}/rtl/RtlIntSafe.c | 13 ++++++-------
modules/rostests/apitests/rtl/testlist.c | 3 +++
modules/rostests/kmtests/CMakeLists.txt | 2 +-
5 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/modules/rostests/apitests/ntdll/testlist.c
b/modules/rostests/apitests/ntdll/testlist.c
index cc19972f5aa..641a756f261 100644
--- a/modules/rostests/apitests/ntdll/testlist.c
+++ b/modules/rostests/apitests/ntdll/testlist.c
@@ -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 },
diff --git a/modules/rostests/apitests/rtl/CMakeLists.txt
b/modules/rostests/apitests/rtl/CMakeLists.txt
index 7c74792dfd5..13bd9b7a718 100644
--- a/modules/rostests/apitests/rtl/CMakeLists.txt
+++ b/modules/rostests/apitests/rtl/CMakeLists.txt
@@ -1,7 +1,7 @@
list(APPEND SOURCE
- # To be filled
+ RtlIntSafe.c
)
if(ARCH STREQUAL "i386")
diff --git a/modules/rostests/kmtests/rtl/RtlIntSafe.c
b/modules/rostests/apitests/rtl/RtlIntSafe.c
similarity index 97%
rename from modules/rostests/kmtests/rtl/RtlIntSafe.c
rename to modules/rostests/apitests/rtl/RtlIntSafe.c
index bc8bd2854ec..bb00bc354c6 100644
--- a/modules/rostests/kmtests/rtl/RtlIntSafe.c
+++ b/modules/rostests/apitests/rtl/RtlIntSafe.c
@@ -5,8 +5,7 @@
* PROGRAMMER: Thomas Faber <thomas.faber(a)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);
diff --git a/modules/rostests/apitests/rtl/testlist.c
b/modules/rostests/apitests/rtl/testlist.c
index ca7ad4c2a50..1eeed3b056b 100644
--- a/modules/rostests/apitests/rtl/testlist.c
+++ b/modules/rostests/apitests/rtl/testlist.c
@@ -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
diff --git a/modules/rostests/kmtests/CMakeLists.txt
b/modules/rostests/kmtests/CMakeLists.txt
index 4dd5572b13a..40c710f0a46 100644
--- a/modules/rostests/kmtests/CMakeLists.txt
+++ b/modules/rostests/kmtests/CMakeLists.txt
@@ -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