[NTDLL_APITEST]
[reactos.git] / rostests / apitests / ntdll / RtlUpcaseUnicodeStringToCountedOemString.c
1 /*
2 * PROJECT: ReactOS API tests
3 * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Test for RtlUpcaseUnicodeStringToCountedOemString
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8 #include <apitest.h>
9
10 #define WIN32_NO_STATUS
11 #include <ndk/rtlfuncs.h>
12
13 START_TEST(RtlUpcaseUnicodeStringToCountedOemString)
14 {
15 NTSTATUS Status;
16 UNICODE_STRING Name;
17 CHAR OemNameBuffer[13];
18 OEM_STRING OemName;
19
20 RtlInitUnicodeString(&Name, L"\x00ae");
21 RtlFillMemory(OemNameBuffer, sizeof(OemNameBuffer), 0x55);
22 OemName.Buffer = OemNameBuffer;
23 OemName.Length = 0;
24 OemName.MaximumLength = sizeof(OemNameBuffer);
25 Status = RtlUpcaseUnicodeStringToCountedOemString(&OemName, &Name, FALSE);
26 ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
27 ok(OemName.Length == 1, "OemName.Length = %u\n", OemName.Length);
28 ok(OemNameBuffer[0] == 'R', "OemNameBuffer[0] = 0x%x\n", OemNameBuffer[0]);
29 ok(OemNameBuffer[1] == 0x55, "OemNameBuffer[1] = 0x%x\n", OemNameBuffer[1]);
30 ok(OemNameBuffer[2] == 0x55, "OemNameBuffer[2] = 0x%x\n", OemNameBuffer[2]);
31 }