[NTOSKRNL] Add a test for ExUuidCreate
authorPierre Schweitzer <pierre@reactos.org>
Sat, 2 Mar 2019 09:29:26 +0000 (10:29 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 2 Mar 2019 09:30:00 +0000 (10:30 +0100)
modules/rostests/kmtests/CMakeLists.txt
modules/rostests/kmtests/kmtest_drv/testlist.c
modules/rostests/kmtests/ntos_ex/ExUuid.c [new file with mode: 0644]

index feb522b..8d56d61 100644 (file)
@@ -54,6 +54,7 @@ list(APPEND KMTEST_DRV_SOURCE
     ntos_ex/ExSequencedList.c
     ntos_ex/ExSingleList.c
     ntos_ex/ExTimer.c
+    ntos_ex/ExUuid.c
     ntos_fsrtl/FsRtlDissect.c
     ntos_fsrtl/FsRtlExpression.c
     ntos_fsrtl/FsRtlLegal.c
index fea8708..11d63bb 100644 (file)
@@ -19,6 +19,7 @@ KMT_TESTFUNC Test_ExResource;
 KMT_TESTFUNC Test_ExSequencedList;
 KMT_TESTFUNC Test_ExSingleList;
 KMT_TESTFUNC Test_ExTimer;
+KMT_TESTFUNC Test_ExUuid;
 KMT_TESTFUNC Test_FsRtlDissect;
 KMT_TESTFUNC Test_FsRtlExpression;
 KMT_TESTFUNC Test_FsRtlLegal;
@@ -90,6 +91,7 @@ const KMT_TEST TestList[] =
     { "ExSequencedList",                    Test_ExSequencedList },
     { "ExSingleList",                       Test_ExSingleList },
     { "-ExTimer",                           Test_ExTimer },
+    { "ExUuid",                             Test_ExUuid },
     { "Example",                            Test_Example },
     { "FsRtlDissect",                       Test_FsRtlDissect },
     { "FsRtlExpression",                    Test_FsRtlExpression },
diff --git a/modules/rostests/kmtests/ntos_ex/ExUuid.c b/modules/rostests/kmtests/ntos_ex/ExUuid.c
new file mode 100644 (file)
index 0000000..2fb0bba
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * PROJECT:         ReactOS kernel-mode tests
+ * LICENSE:         LGPLv2+ - See COPYING.LIB in the top level directory
+ * PURPOSE:         Kernel-Mode Test Suite UUIDs test
+ * PROGRAMMER:      Pierre Schweitzer <pierre@reactos.org>
+ */
+
+#include <kmt_test.h>
+
+#define NDEBUG
+#include <debug.h>
+
+START_TEST(ExUuid)
+{
+    UUID Uuid;
+    NTSTATUS Status;
+
+    Status = ExUuidCreate(&Uuid);
+    ok(Status == STATUS_SUCCESS, "ExUuidCreate returned unexpected status: %lx\n", Status);
+    ok((Uuid.Data3 & 0x1000) == 0x1000, "Invalid UUID version: %x\n", (Uuid.Data3 & 0xF000));
+}