Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks committed Jul 20, 2024
1 parent 2abc963 commit ba85b87
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/test/lib/LockTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ void CxPlatTestLockBasic()
TEST_FALSE(CXPLAT_AT_DISPATCH());
#endif
}

#if defined(CX_PLATFORM_WINKERNEL)
{
CxPlatLockDispatch Lock;
CXPLAT_RAISE_IRQL();
Lock.Acquire();
TEST_TRUE(CXPLAT_AT_DISPATCH());
Lock.Release();
TEST_TRUE(CXPLAT_AT_DISPATCH());
CXPLAT_LOWER_IRQL();
TEST_FALSE(CXPLAT_AT_DISPATCH());
}
#endif
}

void CxPlatTestLockReadWrite()
Expand All @@ -51,7 +64,7 @@ void CxPlatTestLockReadWrite()
#if defined(CX_PLATFORM_WINKERNEL)
TEST_FALSE(CXPLAT_AT_DISPATCH());
#endif
Lock.AcquireExclusive();
Lock.ReleaseShared();
}

{
Expand All @@ -60,9 +73,22 @@ void CxPlatTestLockReadWrite()
#if defined(CX_PLATFORM_WINKERNEL)
TEST_TRUE(CXPLAT_AT_DISPATCH());
#endif
Lock.AcquireExclusive();
Lock.ReleaseShared();
#if defined(CX_PLATFORM_WINKERNEL)
TEST_FALSE(CXPLAT_AT_DISPATCH());
#endif
}

#if defined(CX_PLATFORM_WINKERNEL)
{
CxPlatLockDispatch Lock;
CXPLAT_RAISE_IRQL();
Lock.AcquireShared();
TEST_TRUE(CXPLAT_AT_DISPATCH());
Lock.ReleaseShared();
TEST_TRUE(CXPLAT_AT_DISPATCH());
CXPLAT_LOWER_IRQL();
TEST_FALSE(CXPLAT_AT_DISPATCH());
}
#endif
}

0 comments on commit ba85b87

Please sign in to comment.