[ros-diffs] [tfaber] 52870: [KMTESTS/EX] - add quick'n'dirty tests for interlocked single/double list functions

tfaber at svn.reactos.org tfaber at svn.reactos.org
Mon Jul 25 20:12:45 UTC 2011


Author: tfaber
Date: Mon Jul 25 20:12:44 2011
New Revision: 52870

URL: http://svn.reactos.org/svn/reactos?rev=52870&view=rev
Log:
[KMTESTS/EX]
- add quick'n'dirty tests for interlocked single/double list functions

Added:
    branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c   (with props)
    branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExSingleList.c   (with props)
Modified:
    branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt
    branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild
    branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c

Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt?rev=52870&r1=52869&r2=52870&view=diff
==============================================================================
--- branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] (original)
+++ branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] Mon Jul 25 20:12:44 2011
@@ -15,10 +15,12 @@
 
     example/Example.c
     example/KernelType.c
+    ntos_ex/ExDoubleList.c
     ntos_ex/ExHardError.c
     ntos_ex/ExInterlocked.c
     ntos_ex/ExPools.c
     ntos_ex/ExResource.c
+    ntos_ex/ExSingleList.c
     ntos_ex/ExTimer.c
     ntos_fsrtl/FsRtlExpression.c
     ntos_io/IoDeviceInterface.c

Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild?rev=52870&r1=52869&r2=52870&view=diff
==============================================================================
--- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] (original)
+++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] Mon Jul 25 20:12:44 2011
@@ -15,10 +15,12 @@
 		<file>KernelType.c</file>
 	</directory>
 	<directory name="ntos_ex">
+		<file>ExDoubleList.c</file>
 		<file>ExHardError.c</file>
 		<file>ExInterlocked.c</file>
 		<file>ExPools.c</file>
 		<file>ExResource.c</file>
+		<file>ExSingleList.c</file>
 		<file>ExTimer.c</file>
 	</directory>
 	<directory name="ntos_fsrtl">

Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c?rev=52870&r1=52869&r2=52870&view=diff
==============================================================================
--- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] (original)
+++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] Mon Jul 25 20:12:44 2011
@@ -9,11 +9,13 @@
 #include <kmt_test.h>
 
 KMT_TESTFUNC Test_Example;
+KMT_TESTFUNC Test_ExDoubleList;
 KMT_TESTFUNC Test_ExHardError;
 KMT_TESTFUNC Test_ExHardErrorInteractive;
 KMT_TESTFUNC Test_ExInterlocked;
 KMT_TESTFUNC Test_ExPools;
 KMT_TESTFUNC Test_ExResource;
+KMT_TESTFUNC Test_ExSingleList;
 KMT_TESTFUNC Test_ExTimer;
 KMT_TESTFUNC Test_FsRtlExpression;
 KMT_TESTFUNC Test_IoDeviceInterface;
@@ -28,11 +30,13 @@
 
 const KMT_TEST TestList[] =
 {
+    { "ExDoubleList",                       Test_ExDoubleList },
     { "ExHardError",                        Test_ExHardError },
     { "-ExHardErrorInteractive",            Test_ExHardErrorInteractive },
     { "ExInterlocked",                      Test_ExInterlocked },
     { "ExPools",                            Test_ExPools },
     { "ExResource",                         Test_ExResource },
+    { "ExSingleList",                       Test_ExSingleList },
     { "ExTimer",                            Test_ExTimer },
     { "Example",                            Test_Example },
     { "FsRtlExpression",                    Test_FsRtlExpression },

Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c?rev=52870&view=auto
==============================================================================
--- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c (added)
+++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c [iso-8859-1] Mon Jul 25 20:12:44 2011
@@ -1,0 +1,210 @@
+/*
+ * PROJECT:         ReactOS kernel-mode tests
+ * LICENSE:         GPLv2+ - See COPYING in the top level directory
+ * PURPOSE:         Kernel-Mode Test Suite Doubly-linked list test
+ * PROGRAMMER:      Thomas Faber <thfabba at gmx.de>
+ */
+
+struct _LIST_ENTRY;
+struct _LIST_ENTRY *__stdcall ExInterlockedInsertHeadList(struct _LIST_ENTRY *, struct _LIST_ENTRY *, unsigned long *);
+struct _LIST_ENTRY *__stdcall ExInterlockedInsertTailList(struct _LIST_ENTRY *, struct _LIST_ENTRY *, unsigned long *);
+struct _LIST_ENTRY *__stdcall ExInterlockedRemoveHeadList(struct _LIST_ENTRY *, unsigned long *);
+
+#include <ntddk.h>
+#include <kmt_test.h>
+
+LIST_ENTRY Entries[5];
+
+#define ok_eq_free(Value, Expected) do              \
+{                                                   \
+    if (KmtIsCheckedBuild)                          \
+        ok_eq_pointer(Value, (PVOID)0x0BADD0FF);    \
+    else                                            \
+        ok_eq_pointer(Value, Expected);             \
+} while (0)
+
+#define ok_eq_free2(Value, Expected) do              \
+{                                                   \
+    if (KmtIsCheckedBuild)                          \
+        ok_eq_pointer(Value, (PVOID)0xBADDD0FF);    \
+    else                                            \
+        ok_eq_pointer(Value, Expected);             \
+} while (0)
+
+START_TEST(ExDoubleList)
+{
+    KSPIN_LOCK SpinLock;
+    LIST_ENTRY ListHead;
+    PLIST_ENTRY Ret;
+    
+    KeInitializeSpinLock(&SpinLock);
+    
+    memset(&ListHead, 0x55, sizeof ListHead);
+    InitializeListHead(&ListHead);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &Entries[0]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free(Entries[0].Flink, &ListHead);
+    ok_eq_free(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free(Entries[0].Flink, &ListHead);
+    ok_eq_free(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &Entries[0]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free(Entries[0].Flink, &ListHead);
+    ok_eq_free(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free(Entries[0].Flink, &ListHead);
+    ok_eq_free(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &Entries[0]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[1], &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Flink, &Entries[1]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &Entries[1]);
+    ok_eq_pointer(Entries[1].Flink, &Entries[0]);
+    ok_eq_pointer(Entries[1].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    memset(Entries, 0x55, sizeof Entries);
+#undef ExInterlockedInsertHeadList
+#undef ExInterlockedInsertTailList
+#undef ExInterlockedRemoveHeadList
+
+    memset(&ListHead, 0x55, sizeof ListHead);
+    InitializeListHead(&ListHead);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &Entries[0]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free2(Entries[0].Flink, &ListHead);
+    ok_eq_free2(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free2(Entries[0].Flink, &ListHead);
+    ok_eq_free2(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &Entries[0]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free2(Entries[0].Flink, &ListHead);
+    ok_eq_free2(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedRemoveHeadList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &ListHead);
+    ok_eq_pointer(ListHead.Blink, &ListHead);
+    ok_eq_free2(Entries[0].Flink, &ListHead);
+    ok_eq_free2(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertTailList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Flink, &Entries[0]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    Ret = ExInterlockedInsertHeadList(&ListHead, &Entries[1], &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Flink, &Entries[1]);
+    ok_eq_pointer(ListHead.Blink, &Entries[0]);
+    ok_eq_pointer(Entries[0].Flink, &ListHead);
+    ok_eq_pointer(Entries[0].Blink, &Entries[1]);
+    ok_eq_pointer(Entries[1].Flink, &Entries[0]);
+    ok_eq_pointer(Entries[1].Blink, &ListHead);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+    
+    KmtSetIrql(PASSIVE_LEVEL);
+}

Propchange: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExDoubleList.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExSingleList.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExSingleList.c?rev=52870&view=auto
==============================================================================
--- branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExSingleList.c (added)
+++ branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExSingleList.c [iso-8859-1] Mon Jul 25 20:12:44 2011
@@ -1,0 +1,128 @@
+/*
+ * PROJECT:         ReactOS kernel-mode tests
+ * LICENSE:         GPLv2+ - See COPYING in the top level directory
+ * PURPOSE:         Kernel-Mode Test Suite Singly-linked list test
+ * PROGRAMMER:      Thomas Faber <thfabba at gmx.de>
+ */
+
+struct _SINGLE_LIST_ENTRY;
+struct _SINGLE_LIST_ENTRY *__stdcall ExInterlockedPushEntryList(struct _SINGLE_LIST_ENTRY *, struct _SINGLE_LIST_ENTRY *, unsigned long *);
+struct _SINGLE_LIST_ENTRY *__stdcall ExInterlockedPopEntryList(struct _SINGLE_LIST_ENTRY *, unsigned long *);
+
+#include <ntddk.h>
+#include <kmt_test.h>
+
+SINGLE_LIST_ENTRY Entries[5];
+
+#define ok_eq_free2(Value, Expected) do              \
+{                                                   \
+    if (KmtIsCheckedBuild)                          \
+        ok_eq_pointer(Value, (PVOID)0xBADDD0FF);    \
+    else                                            \
+        ok_eq_pointer(Value, Expected);             \
+} while (0)
+
+START_TEST(ExSingleList)
+{
+    KSPIN_LOCK SpinLock;
+    SINGLE_LIST_ENTRY ListHead;
+    PSINGLE_LIST_ENTRY Ret;
+
+    KeInitializeSpinLock(&SpinLock);
+
+    memset(Entries, 0x55, sizeof Entries);
+    ListHead.Next = NULL;
+    Ret = ExInterlockedPushEntryList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPopEntryList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Next, NULL);
+    ok_eq_free2(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPopEntryList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Next, NULL);
+    ok_eq_free2(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPushEntryList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPushEntryList(&ListHead, &Entries[1], &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Next, &Entries[1]);
+    ok_eq_pointer(Entries[1].Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPopEntryList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[1]);
+    ok_eq_pointer(ListHead.Next, &Entries[0]);
+    ok_eq_free2(Entries[1].Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+#undef ExInterlockedPushEntryList
+#undef ExInterlockedPopEntryList
+    memset(Entries, 0x55, sizeof Entries);
+    ListHead.Next = NULL;
+    Ret = ExInterlockedPushEntryList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPopEntryList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Next, NULL);
+    ok_eq_free2(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPopEntryList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Next, NULL);
+    ok_eq_free2(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPushEntryList(&ListHead, &Entries[0], &SpinLock);
+    ok_eq_pointer(Ret, NULL);
+    ok_eq_pointer(ListHead.Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPushEntryList(&ListHead, &Entries[1], &SpinLock);
+    ok_eq_pointer(Ret, &Entries[0]);
+    ok_eq_pointer(ListHead.Next, &Entries[1]);
+    ok_eq_pointer(Entries[1].Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    Ret = ExInterlockedPopEntryList(&ListHead, &SpinLock);
+    ok_eq_pointer(Ret, &Entries[1]);
+    ok_eq_pointer(ListHead.Next, &Entries[0]);
+    ok_eq_free2(Entries[1].Next, &Entries[0]);
+    ok_eq_pointer(Entries[0].Next, NULL);
+    ok_bool_true(KmtAreInterruptsEnabled(), "Interrupts enabled:");
+    ok_irql(PASSIVE_LEVEL);
+
+    KmtSetIrql(PASSIVE_LEVEL);
+}

Propchange: branches/GSoC_2011/KMTestSuite/kmtests/ntos_ex/ExSingleList.c
------------------------------------------------------------------------------
    svn:eol-style = native




More information about the Ros-diffs mailing list