https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1d8ce79080499741713c8…
commit 1d8ce79080499741713c8d63b894331fd1bb09d9
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Sun Nov 12 11:39:04 2023 +0100
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Thu Nov 16 21:09:08 2023 +0100
[NTDLL_APITEST] Write some tests for NtSetDefaultLocale
---
modules/rostests/apitests/ntdll/CMakeLists.txt | 1 +
.../rostests/apitests/ntdll/NtSetDefaultLocale.c | 43 ++++++++++++++++++++++
modules/rostests/apitests/ntdll/testlist.c | 2 +
3 files changed, 46 insertions(+)
diff --git a/modules/rostests/apitests/ntdll/CMakeLists.txt
b/modules/rostests/apitests/ntdll/CMakeLists.txt
index acc24d45a3e..f48d4e53dec 100644
--- a/modules/rostests/apitests/ntdll/CMakeLists.txt
+++ b/modules/rostests/apitests/ntdll/CMakeLists.txt
@@ -47,6 +47,7 @@ list(APPEND SOURCE
NtQueryVolumeInformationFile.c
NtReadFile.c
NtSaveKey.c
+ NtSetDefaultLocale.c
NtSetInformationFile.c
NtSetInformationProcess.c
NtSetInformationThread.c
diff --git a/modules/rostests/apitests/ntdll/NtSetDefaultLocale.c
b/modules/rostests/apitests/ntdll/NtSetDefaultLocale.c
new file mode 100644
index 00000000000..ad50dac80fa
--- /dev/null
+++ b/modules/rostests/apitests/ntdll/NtSetDefaultLocale.c
@@ -0,0 +1,43 @@
+/*
+ * PROJECT: ReactOS API tests
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Tests for the NtSetDefaultLocale API
+ * COPYRIGHT: Copyright 2023 George Bișoc <george.bisoc(a)reactos.org>
+ */
+
+#include "precomp.h"
+
+START_TEST(NtSetDefaultLocale)
+{
+ NTSTATUS Status;
+
+ Status = NtSetDefaultLocale(TRUE, 0xffffffff);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 0xfffffffe);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 0x7fffffff);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 0x7ffffffe);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 0x80000000);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 0x80000001);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 0x10000);
+ ok_ntstatus(Status, STATUS_INVALID_PARAMETER);
+
+ Status = NtSetDefaultLocale(TRUE, 1);
+ ok_ntstatus(Status, STATUS_OBJECT_NAME_NOT_FOUND);
+
+ Status = NtSetDefaultLocale(TRUE, 0x0C);
+ ok_ntstatus(Status, STATUS_OBJECT_NAME_NOT_FOUND);
+
+ Status = NtSetDefaultLocale(TRUE, 0x1000);
+ ok_ntstatus(Status, STATUS_OBJECT_NAME_NOT_FOUND);
+}
diff --git a/modules/rostests/apitests/ntdll/testlist.c
b/modules/rostests/apitests/ntdll/testlist.c
index 641a756f261..6d22f349692 100644
--- a/modules/rostests/apitests/ntdll/testlist.c
+++ b/modules/rostests/apitests/ntdll/testlist.c
@@ -43,6 +43,7 @@ extern void func_NtQueryValueKey(void);
extern void func_NtQueryVolumeInformationFile(void);
extern void func_NtReadFile(void);
extern void func_NtSaveKey(void);
+extern void func_NtSetDefaultLocale(void);
extern void func_NtSetInformationFile(void);
extern void func_NtSetInformationProcess(void);
extern void func_NtSetInformationThread(void);
@@ -142,6 +143,7 @@ const struct test winetest_testlist[] =
{ "NtQueryVolumeInformationFile", func_NtQueryVolumeInformationFile },
{ "NtReadFile", func_NtReadFile },
{ "NtSaveKey", func_NtSaveKey},
+ { "NtSetDefaultLocale", func_NtSetDefaultLocale },
{ "NtSetInformationFile", func_NtSetInformationFile },
{ "NtSetInformationProcess", func_NtSetInformationProcess },
{ "NtSetInformationThread", func_NtSetInformationThread },